Skip to content

raisebook/postcss-modules-resolve-path

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

A CSS Modules transform to searches paths to resolve compose directives

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 69.3%
  • CSS 30.7%