1.0.0 • Published 8 years ago

postcss-modules-resolve-path v1.0.0

Weekly downloads
926
License
MIT
Repository
github
Last release
8 years ago

CSS Modules: Search paths to resolve compose directives

Build Status NPM version

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 watch src for changes and rebuild
  • npm autotest will watch src and test for changes and retest

License

MIT