Skip to content

Commit 7644f73

Browse files
mareksuscakTimer
authored andcommitted
Mention .module.scss/sass convention (facebook#5145)
1 parent 27ac52a commit 7644f73

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

packages/react-scripts/template/README.md

+4
Original file line numberDiff line numberDiff line change
@@ -515,6 +515,8 @@ If you are concerned about using Webpack-specific semantics, you can put all you
515515

516516
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]**.
517517

518+
> **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*.
519+
518520
An advantage of this is the ability to repeat the same classname within many CSS files without worrying about a clash.
519521

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

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

590594
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.

0 commit comments

Comments
 (0)