# postcss-icss

> Postcss plugin to process css modules and extract tokens

Latest version **2.1.0** (published 2017-05-30) · MIT license · 0 weekly downloads

## Install

```sh
npm install postcss-icss
pnpm add postcss-icss
yarn add postcss-icss
bun add postcss-icss
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.1.0 |
| Published | 2017-05-30 |
| First published | 2017-05-28 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 4 |
| Known vulnerabilities | 0 (+6 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 4 |
| Author | Alexey Litvinov |
| Maintainers | trysound |
| Keywords | css-modules, postcss, css, icss, postcss-plugin |

## Links

- npm: https://www.npmjs.com/package/postcss-icss
- Repository: https://github.com/css-modules/postcss-icss
- Homepage: https://github.com/css-modules/postcss-icss#readme
- Issues: https://github.com/css-modules/postcss-icss/issues
- npm.io page: https://npm.io/package/postcss-icss

## Dependencies (4)

- [postcss](https://npm.io/package/postcss.md) ^5.0.10
- [icss-utils](https://npm.io/package/icss-utils.md) ^2.1.0
- [lodash.foreach](https://npm.io/package/lodash.foreach.md) ^3.0.3
- [icss-replace-symbols](https://npm.io/package/icss-replace-symbols.md) ^1.0.2

## Alternatives

- [style-dictionary](https://npm.io/package/style-dictionary.md) — 2.0M weekly downloads
- [postcss-merge-idents](https://npm.io/package/postcss-merge-idents.md) — 1.7M weekly downloads
- [@fontsource/noto-sans](https://npm.io/package/@fontsource/noto-sans.md) — 93.0K weekly downloads
- [uglifycss](https://npm.io/package/uglifycss.md) — 71.6K weekly downloads
- [mat4-interpolate](https://npm.io/package/mat4-interpolate.md) — 23.3K weekly downloads

## Recent versions

- 2.1.0 (latest) — 2017-05-30
- 2.0.0 — 2017-05-28

## README

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.

```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 }) ]);
```

---
_Source: https://npm.io/package/postcss-icss · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
