I would like to introduce react-css-modules with React.js.
CSS-Module is a concept for seamless mapping of class names to CSS modules inside of React components.
šø Installation
Install following libraries:
$ npm init -y |
š¹ Setup CSS loader
Add following codes to .babelrc
:
{ |
Please add following codes in webpack.config.js
:
module: { |
š½ Usage
In the context of React, CSS Modules look like this:
/* css/table-custom-styles.scss */ |
In ES6 syntax, we can support CSS like this:
// components/Table.jsx |
ES7 decorators syntax is as follows:
// components/Table.jsx |
Happy Hacking!
š½ Special Thanks
- http://qiita.com/_likr/iā¦
- Modular CSS with React ā Medium
š„ Recommended VPS Service
VULTR provides high performance cloud compute environment for you.
Vultr has 15 data-centers strategically placed around the globe, you can use a VPS with 512 MB memory for just $ 2.5 / month ($ 0.004 / hour).
In addition, Vultr is up to 4 times faster than the competition, so please check it => Check Benchmark Results!!