rsnext/examples/with-react-css-modules/README.md

1.2 KiB

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.