# postcss-modules-sync

> A PostCSS plugin to use CSS Modules synchronously in js

Latest version **1.0.0** (published 2017-01-24) · MIT license · 0 weekly downloads

## Install

```sh
npm install postcss-modules-sync
pnpm add postcss-modules-sync
yarn add postcss-modules-sync
bun add postcss-modules-sync
```

## 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 | 1.0.0 |
| Published | 2017-01-24 |
| First published | 2016-10-25 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 6 |
| Known vulnerabilities | 0 (+6 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 5 |
| Author | schiehll |
| Maintainers | schiehll |
| Keywords | PostCSS, CSS Modules |

## Links

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

## Dependencies (6)

- [postcss](https://npm.io/package/postcss.md) ^5.2.5
- [string-hash](https://npm.io/package/string-hash.md) ^1.1.0
- [generic-names](https://npm.io/package/generic-names.md) ^1.0.2
- [icss-replace-symbols](https://npm.io/package/icss-replace-symbols.md) ^1.0.2
- [postcss-modules-scope](https://npm.io/package/postcss-modules-scope.md) ^1.0.2
- [postcss-modules-local-by-default](https://npm.io/package/postcss-modules-local-by-default.md) ^1.1.1

## Recent versions

- 1.0.0 (latest) — 2017-01-24
- 0.1.0 — 2016-10-25

## README

# postcss-modules-sync 

> A PostCSS plugin to use CSS Modules synchronously in js.

[![version](https://img.shields.io/npm/v/postcss-modules-sync.svg?style=flat-square)](http://npm.im/postcss-modules-sync)
[![MIT License](https://img.shields.io/npm/l/postcss-modules-sync.svg?style=flat-square)](http://opensource.org/licenses/MIT)

## Install
```
npm install postcss-modules-sync
```

## Example
```js
import CSSModulesSync from 'postcss-modules-sync'
import postcss from 'postcss'

const css = `
  :global .text {
    color: white;
    background-color: gray;
  }

  .green {
    background-color: green;
  }

  .blue {
    background-color: blue;
  }

  .default {
    composes: green;
    display: flex;
  }
`

let exportedTokens = {}
const styles = postcss([
  CSSModulesSync({
    generateScopedName: '[path][local]-[hash:base64:10]',
    getJSON: tokens => exportedTokens = tokens
  })
]).process(css).css

console.log('styles', styles)
console.log('tokens', exportedTokens)
```

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