postcss-modules-resolve-path
v1.0.0
Published
A CSS Modules transform to searches paths to resolve compose directives
Downloads
1,397
Readme
CSS Modules: Search paths to resolve compose directives
With this config:
{
'paths': [ 'src/style', 'components/style' ]
}
given two files: 'src/style/base.css' and 'components/style/button.css:
.myClass {
composes: button from "button.css";
color: green;
}
into:
.myClass {
composes: button from "components/style/button.css";
color: green;
}
It will ignore absolute and relative paths, so:
.myClass {
composes: button from "button.css";
color: green;
}
.myClass2 {
composes: button from "/button.css";
color: green;
}
.myClass3 {
composes: button from "./button.css";
color: green;
}
will still be:
.myClass {
composes: button from "components/style/button.css";
color: green;
}
.myClass2 {
composes: button from "/button.css";
color: green;
}
.myClass3 {
composes: button from "./button.css";
color: green;
}
Options
- paths - array of search paths
Building
npm install
npm build
npm test
Development
npm watch
will watchsrc
for changes and rebuildnpm autotest
will watchsrc
andtest
for changes and retest
License
MIT