babel-plugin-jsonify-css
Installation
$ yarn add --dev babel-plugin-jsonify-css
Usage
Add jsonify-css
to the plugins
section of your .babelrc
:
"plugins": "jsonify-css"
After setting the project, you may import CSS files like so:
// .css files now conveniently expose all styles as js objects; // If you are using glamor, you can easily generate styles like so;const className = ; // Don't forget any custom fonts or animations :)const fonts = fontFace;const animations = keyframes;