material-design-lite/README.md

140 lines
5.6 KiB
Markdown
Raw Normal View History

# Material Design Lite
2014-04-16 06:26:21 -07:00
> A library of [Material Design](http://www.google.com/design/spec/material-design/introduction.html) components in CSS, JS and HTML
2015-02-04 22:46:41 -08:00
Material Design Lite lets you add a Material Design look and feel to your static content websites. It doesnt rely on any JavaScript frameworks and aims to optimise for cross-device use, gracefully degrade in older browsers and offer an experience that is accessible from the get-go.
2015-02-09 06:20:21 -08:00
## Quick start
Four quick start options are available:
- [Download the latest release](https://github.com/google/material-design-lite/archive/master.zip).
- Clone the repo: `git clone https://github.com/google/material-design-lite.git`.
- Install with [Bower](http://bower.io): `bower install material-design-lite`.
- Install with [npm](https://www.npmjs.org): `npm install material-design-lite`.
### What's included
Within the download you'll find the following directories and files, logically grouping common assets and providing both compiled and minified variations. You'll see something like this:
```
├── css
│   ├── material.css
│   └── material.min.css
├── js
│   ├── material.js
│   ├── material.min.js
│   └── material.min.js.map
2015-04-16 06:55:28 -07:00
├── templates
2015-02-09 06:20:21 -08:00
├── images
├── src
├── package.json
├── bower.json
├── gulpfile.js
├── LICENSE
├── README.md
```
2015-04-16 06:55:28 -07:00
We provide compiled CSS and JS (`material.*`), as well as compiled and minified CSS and JS (`material.min.*`). JS source maps (`material.*.map`) are available for use with certain browsers' developer tools.
2014-04-16 07:12:57 -07:00
2015-02-04 02:14:46 -08:00
## Getting Started
2014-04-16 07:12:57 -07:00
2015-02-04 22:46:41 -08:00
### Download
Clone or
[download](https://github.com/google/material-design-lite/archive/master.zip)
this repository, [build it](#development) and reference the following files in your project:
2014-05-23 12:02:58 -07:00
2015-02-04 02:14:46 -08:00
```html
<script src="dist/js/material.min.js"></script>
<link rel="stylesheet" href="dist/css/material.min.css">
2015-02-04 02:14:46 -08:00
```
2015-02-04 02:14:46 -08:00
You will want to include the entire package to ensure optional assets like images or fonts are correctly
included.
2014-05-27 02:27:36 -07:00
2015-02-04 22:46:41 -08:00
### npm
2014-06-16 07:03:08 -07:00
2015-02-04 22:46:41 -08:00
```
$ npm install --save material-design-lite
2015-02-04 02:14:46 -08:00
```
2014-06-19 05:50:10 -07:00
2015-02-04 22:46:41 -08:00
### bower
2014-05-16 02:59:52 -07:00
2015-02-04 22:46:41 -08:00
```
$ bower install --save material-design-lite
2015-02-04 02:14:46 -08:00
```
2014-06-16 03:26:01 -07:00
2015-02-04 22:46:41 -08:00
2015-02-04 02:14:46 -08:00
## Development
2014-06-19 07:22:40 -07:00
2015-02-04 02:14:46 -08:00
The sources (JS, Sass) and demo files for all components can be found in the `src` directory. To get started
modifying them, first install the necessary dependencies, from the root of the project:
2014-06-16 03:26:01 -07:00
2015-02-04 22:46:41 -08:00
```
2015-02-04 02:14:46 -08:00
$ npm install && npm install -g gulp
```
2014-06-16 03:26:01 -07:00
2015-02-04 02:14:46 -08:00
Next, run the following one-liner to preview the components:
2014-06-16 03:26:01 -07:00
2015-02-04 22:46:41 -08:00
```
2015-02-04 02:14:46 -08:00
$ gulp serve
```
2014-06-06 03:55:13 -07:00
2015-02-04 02:14:46 -08:00
Any changes made to files inside the `src` directory will cause the page to reload. This page can also be loaded
up on physical devices thanks to BrowserSync.
2015-02-04 02:14:46 -08:00
To build a production version of the components, run:
2015-02-04 22:46:41 -08:00
```
2015-02-04 02:14:46 -08:00
$ gulp
```
2015-02-04 02:14:46 -08:00
This will clean and update the `css`, `js` and `images` directories in the root of the project with minified and
concatenated versions of the component files. Namely, `css/material.min.css` and `js/material.min.js`.
2014-06-16 03:14:04 -07:00
2015-04-16 06:55:28 -07:00
## Templates
The `templates/` subdirectory contains a few exemplary usages of MDL. Templates have their own, quasi-separate
gulp pipeline and can be compiled with `gulp templates`. The templates use the vanilla MDL JS and
[themed](http://google.github.io/material-design-lite/customizer/customizer.html) CSS files. Extraneous
2015-04-16 07:20:39 -07:00
styles are kept in a separate CSS file. Use `gulp serve` to take a look at the templates:
* [General template](http://localhost:3000/templates/general)
* [Blog template](http://localhost:3000/templates/blog) and [blog entry](http://localhost:3000/templates/blog/entry.html)
* [Dashboard template](http://localhost:3000/templates/dashboard)
2015-04-27 08:12:24 -07:00
* [Product template](http://localhost:3000/templates/product)
2015-04-16 06:55:28 -07:00
2015-02-20 17:18:54 -08:00
## Browser Support
| IE8 | IE9 | IE10 | Chrome | Opera | Firefox | Safari | Chrome (Android) | Mobile Safari |
|-----|-----|------|--------|-------|---------|--------|------------------|---------------|
| B | B | A | A | A | A | A | A | A |
A-grade browsers are fully supported. B-grade browsers will gracefully degrade to our CSS-only experience.
## Versioning
For transparency into our release cycle and in striving to maintain backward compatibility, Material Design Lite is maintained under [the Semantic Versioning guidelines](http://semver.org/). Sometimes we screw up, but we'll adhere to those rules whenever possible.
2015-03-30 05:36:22 -07:00
## Feature requests
If you find MDL doesn't contain a particular component you think would be useful, please check the issue tracker in case work has already started on it. If not, you can request new component in the [following](https://github.com/google/material-design-lite/issues/92) thread. Please be sure to include justification for why you think the component should be implemented to help us with planning.
2015-02-04 22:46:41 -08:00
## In-development
Here, you can find early live previews of our work for testing or demo purposes.
* [Visual tests](http://google.github.io/material-design-lite/test/visual/) for components
* [Android.com](http://google.github.io/material-lite-samples/android-dot-com/) Material Design Lite demo
* [Theme customiser prototype](http://google.github.io/material-design-lite/customizer/customizer.html)
## Do you include any features that a framework comes with?
2015-04-16 06:55:28 -07:00
Material Design Lite is focused on delivering a vanilla CSS/JS/HTML library of components. We are not a framework. If you are building a single-page app and require features like two-way data-binding, templating, CSS scoping and so forth, we recommend trying out the excellent [Polymer](http://polymer-project.org) project.
2014-06-06 05:06:29 -07:00
## License
Copyright Google, 2015. Licensed under an Apache-2 license.