postcss-icss

2.1.0 • Public • Published

postcss-icss

A CSS Modules parser to extract tokens from the css file. Provides opportunity to process multiple files.

API

In order to use it you should provide a fetch function which should load contents of files and process it with the PostCSS instance. fetch function should return promise object which will resolve into tokens.

const ICSS = require('postcss-icss');
 
function fetch(importee, importerDir, processor) {
  // load content
  return processor.process(css, { from: filename })
    .then(result => result.messages.find(d => d.type === "icss").exportTokens);
}
 
postcss([ ICSS({ fetch }) ]);

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 2.1.0
    20
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 2.1.0
    20
  • 2.0.0
    0

Package Sidebar

Install

npm i postcss-icss

Weekly Downloads

20

Version

2.1.0

License

MIT

Last publish

Collaborators

  • geelen
  • trysound