Skip to content

Commit

Permalink
Mention .module.scss/sass convention (facebook#5145)
Browse files Browse the repository at this point in the history
  • Loading branch information
mareksuscak authored and Timer committed Sep 27, 2018
1 parent 27ac52a commit 7644f73
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions packages/react-scripts/template/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -515,6 +515,8 @@ If you are concerned about using Webpack-specific semantics, you can put all you

This project supports [CSS Modules](https://github.com/css-modules/css-modules) alongside regular stylesheets using the **[name].module.css** file naming convention. CSS Modules allows the scoping of CSS by automatically creating a unique classname of the format **[filename]\_[classname]\_\_[hash]**.

> **Tip:** Should you want to preprocess a stylesheet with Sass then make sure to [follow the installation instructions](#adding-a-sass-stylesheet) and then change the stylesheet file extension as follows: *[name].module.scss* or *[name].module.sass*.
An advantage of this is the ability to repeat the same classname within many CSS files without worrying about a clash.

### `Button.module.css`
Expand Down Expand Up @@ -585,6 +587,8 @@ This will allow you to do imports like
@import 'nprogress/nprogress'; // importing a css file from the nprogress node module
```

> **Tip:** You can opt into using this feature with [CSS modules](#adding-a-css-modules-stylesheet) too!
## Post-Processing CSS

This project setup minifies your CSS and adds vendor prefixes to it automatically through [Autoprefixer](https://github.com/postcss/autoprefixer) so you don’t need to worry about it.
Expand Down

0 comments on commit 7644f73

Please sign in to comment.