CSS Modules: Scope Locals & Extend
Transforms:
into:
so it doesn't pollute CSS global scope and can be simply used in JS like so:
Composition
Since we're exporting class names, there's no reason to export only one. This can give us some really useful reuse of styles:
becomes:
Note: you can also use composes
as a shorthand for compose-with
Local-by-default & reuse across files
You're looking for CSS Modules. It uses this plugin as well as a few others, and it's amazing.
Building
Development
npm autotest
will watchsrc
andtest
for changes and run the tests, and transpile the ES6 to ES5 on success
License
ISC
With thanks
Mark Dalgleish
Tobias Koppers
Guy Bedford
Glen Maddern, 2015.
Last updated