Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add documentation for CSS Modules #694

Merged
merged 1 commit into from
Jul 11, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ If your application is running, and you need to manually restart your server, yo
* [Customizing Babel Config](#customizing-babel-config)
* [Extending Webpack](#extending-webpack)
* [Extending ESLint](#extending-eslint)
* [CSS Modules](#css-modules)
* [Environment Variables](#environment-variables)
* [Build-time Variables](#build-time-variables)
* [Runtime Variables](#runtime-variables)
Expand Down Expand Up @@ -213,6 +214,20 @@ Razzle comes with [Create React App's ESLint configuration](https://github.com/f
}
```

### CSS Modules

Razzle supports [CSS Modules](https://github.com/css-modules/css-modules) using Webpack's [css-loader](https://github.com/webpack-contrib/css-loader). Simply import your CSS file with the extension `.module.css` and Razzle will process the file using `css-loader`.

```jsx
import React from 'react';
import styles from './style.module.css';

const Component = () => <div className={styles.className} />;

export default Component;
```


## Environment Variables

### Build-time Variables
Expand Down