Contents
Precompiled code
The Material precompiled code download includes the following:
This is the most basic form of Material: precompiled files for quick drop-in usage in nearly any web project.
We provide compiled CSS and JavaScript (material.*
), as well as compiled and minified CSS and JavaScript (material.min.*
).
Extra CSS for plugins is stored in (material-plugins.css
) and minified in (material-plugins.min.css
). Respective JavaScript for each plugin has to be imported manually (refer to Plugins section).
Check the starter template for a basic set up guide.
Source code
The Material source code download includes the precompiled CSS and JavaScript, along with documentation and source assets. More specifically, it includes the following and more:
The assets/
is the source code for our CSS and JavaScript.
The css/
and js/
folders are the same in the precompiled download section above.
The docs/
folder includes the source code for our documentation. Beyond that, any other included file provides support for development.
Check the theming guide for how to customise Material for your project using our source code.
Important globals
Material employs a handful of important global styles and settings that you’ll need to be aware of when using it, all of which are almost exclusively geared towards the normalization of cross browser styles. Let’s dive in.
Box-sizing
For more straightforward sizing in CSS, we switch the global box-sizing
value from content-box
to border-box
. This ensures padding
does not affect the final computed width of an element, but it can cause problems with some third party software like Google Maps.
On the rare occasion you need to override it, use something like the following:
With the above snippet, nested elements—including generated content via :before
and :after
will all inherit the specified box-sizing
for that .selector-for-some-widget
.
Learn more about box model and sizing at CSS Tricks.
HTML5 doctype
Material requires the use of the HTML5 doctype. Without it, you’ll see some funky incomplete styling, but including it shouldn’t cause any considerable hiccups.
Responsive meta tag
Material is developed mobile first, a strategy in which we optimize code for mobile devices first and then scale up components as necessary using CSS media queries. To ensure proper rendering and touch zooming for all devices, add the responsive viewport meta tag to your <head>
.
Starter template
Be sure to have your pages set up with the latest design and development standards. That means using an HTML5 doctype and including a viewport meta tag for proper responsive behaviors. Put it all together and your pages should look like this:
That’s all you need for overall page requirements.