Intro
This package allows you to quickly and cleanly integrate Google's Material Design Lite into your Laravel project, while still giving you flexibility.
If your frontend will be heavily composed of vue components, you may want to also check out vue-mdl.
Installation
This package can work with new or existing Laravel projects. If you don't already have a Laravel application, create one.
Then, install the package:
npm install --save-dev laravel-materialize
Usage
In your gulpfile.js
, require and use the package. For example:
const elixir = ; ;; ;
Run gulp
to compile the assets.
Include the assets in your layout by adding this to your <head>
<!-- Material Styles -->
And this right before the end of your <body>
<!-- Material JavaScripts -->
Now go add mdl components and classes to your views! Check out the mdl documentation for quick reference.
For example, add a simple button to any of your views to make sure everything is working:
<!-- Colored FAB button with ripple --> add
Customization
Want to change the colors of your app? How about the font? Want to tweak the defaults of Material Design to make it unique to your app? Sure, it's easy!
Create a file called _mdl-variables.scss
within resources/assets/sass
and set whatever MDL variables you want. For example:
// colors ;; ;; // font ;;
For a full list of variables you can set, see here;
Note: The sass color variables defined by MDL (ex: $palette-indigo-500
) will automatically be injected for you.
Another Note: If you are specifying your own color value, some of the colors will only work if you give an rgb value. (ex: 0, 0, 0
, rather than #000
or rgb(0,0,0)
) -- more info can be found in the issues here.
Contributing
Go for it.