Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/birdofpreyru/postcss-icss
PostCSS plugin to process CSS modules and extract tokens
https://github.com/birdofpreyru/postcss-icss
css css-modules javascript modules plugin postcss web
Last synced: 4 days ago
JSON representation
PostCSS plugin to process CSS modules and extract tokens
- Host: GitHub
- URL: https://github.com/birdofpreyru/postcss-icss
- Owner: birdofpreyru
- License: mit
- Fork: true (css-modules/postcss-icss)
- Created: 2020-09-23T16:36:07.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2023-04-09T00:07:39.000Z (almost 2 years ago)
- Last Synced: 2025-01-16T11:28:13.816Z (8 days ago)
- Topics: css, css-modules, javascript, modules, plugin, postcss, web
- Language: JavaScript
- Homepage: https://dr.pogodin.studio/docs/postcss-modules-parser
- Size: 224 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
_A fork of [`postcss-icss` Git repository](https://github.com/css-modules/postcss-icss), updated to use the latest dependency versions. The Git repo hosts codebases of both **postcss-modules-parser** (older), and **postcss-icss** (newer) NPM packages. The present fork updates and releases **postcss-modules-parser** only (see the branch of the same name)._
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.```js
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 }) ]);
```