@nodejs-loaders/css-module
v1.2.0
Published
Extend node to support css modules via customization hooks.
Readme
Nodejs Loaders: CSS Module
Usage
$ npm i -D @nodejs-loaders/css-module$ node --import @nodejs-loaders/css-module main.jsSee README.md in the repository's root for more details.
Environment: test
Compatible APIs:
This loads the module as a plain-object of simple key-value pairs of the css specifiers like:
/* main.module.css */
#Bar {
font-weight: bold;
}
.Foo {
text-decoration: none
.Baz { color: red }
}
.Qux .Zed {
font-size: 1.1em;
}import styles from 'main.module.css';
styles.Bar; // 'Bar'
styles.Baz; // 'Baz'
styles.Foo; // 'Foo'
styles.Zed; // 'Zed'This ensures snapshots are unaffected by unrelated changes.
[!WARNING] This loader does not differentiate classes vs ids; thus duplicate names can create a last-wins conflict. For example
#Fooand.Foowill result in justFoo: 'Foo'. This is unlikely to cause any real-world problems (and you probably shouldn't be doing this anyway).
