rsnext/examples/with-react-css-modules
2019-05-06 20:05:42 -05:00
..
pages Add example with babel-plugin-react-css-modules (#7219) 2019-05-06 20:05:42 -05:00
.babelrc Add example with babel-plugin-react-css-modules (#7219) 2019-05-06 20:05:42 -05:00
next.config.js Add example with babel-plugin-react-css-modules (#7219) 2019-05-06 20:05:42 -05:00
package.json Add example with babel-plugin-react-css-modules (#7219) 2019-05-06 20:05:42 -05:00
README.md Add example with babel-plugin-react-css-modules (#7219) 2019-05-06 20:05:42 -05:00

react-css-modules example

How to use

Using create-next-app

Execute create-next-app with Yarn or npx to bootstrap the example:

npx create-next-app --example with-react-css-modules with-react-css-modules-app
# or
yarn create next-app --example with-react-css-modules with-react-css-modules-app

Download manually

Download the example:

curl https://codeload.github.com/zeit/next.js/tar.gz/canary | tar -xz --strip=2 next.js-canary/examples/with-react-css-modules
cd with-react-css-modules

Install it and run:

npm install
npm run dev
# or
yarn
yarn dev

Deploy it to the cloud with now (download)

now

The idea behind the example

react-css-modules implement automatic mapping of CSS modules. Every CSS class is assigned a local-scoped identifier with a global unique name.

This example shows how to integrate babel-plugin-react-css-modules in Next.js.