-
-
Notifications
You must be signed in to change notification settings - Fork 298
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #216 from mlaursen/release/1.0.x
Release/1.0.x
- Loading branch information
Showing
68 changed files
with
985 additions
and
695 deletions.
There are no files selected for viewing
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
*Before* submitting a pull request, please make sure the following is done: | ||
|
||
1. For the repo and create your branch from `release/MAJOR.MINOR.x`. At the time of creating this, react-md is at version | ||
v1.0.0, so you would branch off of `release/1.0.x`. | ||
2. If you have added code that should be tested, please add tests. | ||
3. If you have added new prop types or deprecated prop types, please update the docgen descriptions. When TypeScript is fully | ||
implemented, update the types as well. | ||
4. Ensure that the teset suite passes (`npm test`). | ||
5. Ensure that your code lints (`npm run lint`). | ||
> NOTE: Sass changes rely on the Ruby version of `sass` and `scss-lint` to work. | ||
|
||
6. If your pull request attempts to fix an existing issue, please reference that issue via a commit message | ||
or the pull request comment. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,7 +3,7 @@ | |
React Material Design - React components built with sass | ||
|
||
[![Build Status](https://travis-ci.org/mlaursen/react-md.svg?branch=master)](https://travis-ci.org/mlaursen/react-md) | ||
[![Join the chat at https://gitter.im/mlaursen/react-md](https://badges.gitter.im/mlaursen/react-md.svg)](https://gitter.im/mlaursen/react-md?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) [![Donate](https://img.shields.io/badge/donate-paypal-blue.svg?style=flat-square)](https://paypal.me/mlaursen03) | ||
[![Join the chat at Slack](https://react-md.herokuapp.com/badge.svg)](https://react-md.herokuapp.com) [![Join the chat at https://gitter.im/mlaursen/react-md](https://badges.gitter.im/mlaursen/react-md.svg)](https://gitter.im/mlaursen/react-md?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) [![Donate](https://img.shields.io/badge/donate-paypal-blue.svg?style=flat-square)](https://paypal.me/mlaursen03) | ||
|
||
react-md is a set of React components and sass files for implementing [Google's Material Design](https://material.google.com). The | ||
[Documentation Website](http://react-md.mlaursen.com) can be used for viewing live examples, code samples, and general prop documentation. | ||
|
@@ -20,6 +20,61 @@ $ npm i -S react \ | |
|
||
## Usage | ||
|
||
### Using create-react-app | ||
`create-react-app` does [not support Sass](https://github.com/facebookincubator/create-react-app/issues/78), so | ||
here are some steps to get it working: | ||
|
||
```bash | ||
$ create-react-app my-app --scripts-version --custom-react-scripts | ||
$ npm i -S react-md | ||
``` | ||
|
||
Customize the `.env` to include SASS. See [custom-react-scripts](https://github.com/kitze/create-react-app) | ||
for more information. | ||
|
||
If this is not a solution for you, you can always run `yarn run eject` (or `npm run eject`) from your app and add Sass yourself. | ||
|
||
```bash | ||
$ create-react-app my-app | ||
$ yarn run eject | ||
$ yarn add react-md | ||
$ yarn add --dev sass-loader node-sass | ||
$ vim -O config/webpack.config.dev.js config/webpack.config.prod.js | ||
``` | ||
|
||
Add an scss/sass exclusion on line 109 (webpack.config.dev.js) and line 115 (webpack.config.prod.js) | ||
|
||
```js | ||
exclude: [ | ||
/\.html$/, | ||
/\.(js|jsx)$/, | ||
/\.css$/, | ||
/\.json$/, | ||
/\.svg$/, | ||
/\.s(c|a)ss$/, | ||
], | ||
``` | ||
|
||
In the dev config, add a new loader after the CSS loader: | ||
|
||
```js | ||
{ | ||
test: /\.s(a|c)ss$/, | ||
loader: 'style!css?importLoaders=2!postcss!sass?sourceMap&outputStyle=expanded' | ||
}, | ||
``` | ||
|
||
In the prod config: | ||
```js | ||
{ | ||
test: /\.s(a|c)ss$/, | ||
loader: ExtractTextPlugin.extract('style', 'css?importLoaders=2!postcss!sass?outputStyle=compressed') | ||
}, | ||
``` | ||
|
||
### Using one of the Boilerplates | ||
If `create-react-app` is not your thing, you can try using one of the available [boilerplates](https://react-md.mlaursen.com/discover-more/boilerplates). | ||
|
||
### Basic Webpack Usage | ||
|
||
```js | ||
|
@@ -70,12 +125,12 @@ You can also use the UMD build from [unpkg](https://unpkg.com/#/): | |
|
||
```html | ||
<!-- Production Version --> | ||
<link rel="stylesheet" href="https://unpkg.com/[email protected].0/dist/react-md.deep_purple-pink.min.css"> | ||
<script src="https://unpkg.com/[email protected].0/dist/react-md.min.js"></script> | ||
<link rel="stylesheet" href="https://unpkg.com/[email protected].1/dist/react-md.deep_purple-pink.min.css"> | ||
<script src="https://unpkg.com/[email protected].1/dist/react-md.min.js"></script> | ||
|
||
<!-- Development Version --> | ||
<!-- development version of CSS unavailable --> | ||
<script src="https://unpkg.com/[email protected].0/dist/react-md.js"></script> | ||
<script src="https://unpkg.com/[email protected].1/dist/react-md.js"></script> | ||
``` | ||
|
||
|
||
|
@@ -85,14 +140,14 @@ You can also use the UMD build from [unpkg](https://unpkg.com/#/): | |
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<link rel="stylesheet" href="https://unpkg.com/[email protected].0/dist/react-md.deep_purple-pink.min.css"> | ||
<link rel="stylesheet" href="https://unpkg.com/[email protected].1/dist/react-md.deep_purple-pink.min.css"> | ||
<link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons|Roboto:400,500,700"> | ||
</head> | ||
<body> | ||
<div id="app"></div> | ||
<script src="https://unpkg.com/react/dist/react-with-addons.min.js"></script> | ||
<script src="https://unpkg.com/react-dom/dist/react-dom.min.js"></script> | ||
<script src="https://unpkg.com/[email protected].0/dist/react-md.min.js"></script> | ||
<script src="https://unpkg.com/[email protected].1/dist/react-md.min.js"></script> | ||
<script> | ||
var MyAwesomeComponent = React.createClass({ | ||
render: function() { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.