postcss-inline-trait

0.2.0 • Public • Published

PostCSS Inline Trait Build Status

PostCSS plugin which allows for inline declaration of CSS properties whose values will be imported from a traits directory..

Converts:

.foo {
    /* .css file-ending is optional */
    /* path is assumed to be ./common/css/traits/fancy.trait */
    trait: superFancy from 'fancy.trait';
}

/* fancy.css */
.superFancy {
    background-color: 'pink';
}

into:

.foo {
  background-color: 'pink';
}

Usage

var inlineTrait = require('postcss-inline-trait');
postcss([inlineTrait({
    getFileText: function(path){
        // return environment-specific means of retrieving text at path such as Node's fs.readFile or SystemJS fetch
        // e.g:
        return System.normalize(path).then(System.import.bind(System));
    }
})])

See PostCSS docs for examples for your environment.

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
0.2.00latest

Version History

VersionDownloads (Last 7 Days)Published
0.2.00
0.1.00

Package Sidebar

Install

npm i postcss-inline-trait

Weekly Downloads

0

Version

0.2.0

License

MIT

Last publish

Collaborators

  • meomix