next-css-json-loader
Installation
$ npm install --save-dev next-css-json-loader
Setup
First you will need to create a next.config.js
file:
moduleexports = { configmodulerules; return config; };
Usage
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;
Shout out to next-style-loader for inspiration!