- Notifications
You must be signed in to change notification settings - Fork0
RegisBiron/css-modules-share
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
This is the supplementary repository for my css modules share.
- nvm
- can be installed followingthese instructions
- yarn
- can be installed with homebrew:
brew install yarn
- optionally installed with npm:
npm install yarn --g
- can be installed with homebrew:
- clone this repo
nvm use
yarn install
npm run start
- Starts thewebpack-dev-server
and usesreact-hot-loader
for HMR
- css modules docs
- This repo uses React and in order for React / Webpack CSS Loader to interpolate your styles use the following pattern
importstylesfrom'./styles.css';<pclassName={styles.summaryText}>Lorem ipsum dolor sit amet...</p>
/* styles.css */.summaryText {font-size:1rem;color: blue;}
- The official CSS Modules docs suggest to use camelCase fornaming.
- This repo uses PostCSS as a post-processor feel free to add in more plugins
yarn add --dev postcss-plugin-name
Locate the postcss.config.js file in the root directory
module.exports={plugins:[require('autoprefixer'),// add your plugin here]};