0.3.2 • Published 7 years ago
node-stylus-css-modules-require v0.3.2
node-stylus-css-modules-require
Allows require to import css-module objects(tokens) from stylus files. The module provides a simple way to transform content before it’ll begin compiling. A post-hook is also available if any changes should be done after the stylus compiler finishes and before the generation of css-module tokens starts. All parameters are optional.
install
npm install --save node-stylus-css-modules-require
usage
nodeStylusRequire(
/* scope naming */
)(
/* pre-transformer */
)(
/* post-transformer */
);
nodeStylusRequire('[name]__[local]___[hash:base64:5]')(
function preTransformer(fileContent) {
/* ... */
return fileContent;
}
)(
function postTransformer(css) {
/* ... */
return css;
}
);
const style = require('./some-style.styl');