# postcss-extract-styles

> PostCSS plugin that extracts styles from css based on decelerations matching.

Latest version **1.2.0** (published 2018-02-24) · MIT license · 0 weekly downloads

## Install

```sh
npm install postcss-extract-styles
pnpm add postcss-extract-styles
yarn add postcss-extract-styles
bun add postcss-extract-styles
```

## 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.2.0 |
| Published | 2018-02-24 |
| First published | 2016-11-29 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 4.3 KB |
| Known vulnerabilities | 0 (+6 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 4 |
| Author | Felix |
| Maintainers | felixmosh |
| Keywords | postcss, css, postcss-plugin, extract-styles |

## Links

- npm: https://www.npmjs.com/package/postcss-extract-styles
- Repository: https://github.com/felixmosh/postcss-extract-styles
- Issues: https://github.com/felixmosh/postcss-extract-styles/issues
- npm.io page: https://npm.io/package/postcss-extract-styles

## Dependencies (1)

- [postcss](https://npm.io/package/postcss.md) ^6.0.1

## 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

- 1.2.0 (latest) — 2018-02-24
- 1.1.1 — 2017-05-23
- 1.1.0 — 2016-12-08
- 1.0.1 — 2016-12-05
- 1.0.0 — 2016-11-29

## README

# PostCSS Extract Styles [![Build Status][ci-img]][ci] [![npm](https://img.shields.io/npm/v/postcss-extract-styles.svg)](https://www.npmjs.com/package/postcss-extract-styles)

[PostCSS] plugin that extracts styles from css based on deceleration matching.

[PostCSS]: https://github.com/postcss/postcss
[ci-img]:  https://travis-ci.org/felixmosh/postcss-extract-styles.svg
[ci]:      https://travis-ci.org/felixmosh/postcss-extract-styles

## Options
`pattern` : Regex | Array<Regex>

## Usage

```js
const options = {
  pattern: /{{[^\}]+}}/g
};
postcss([ require('postcss-extract-styles')(options) ]
  .then((result) => {
     result.css // would be the "remain" part
     result.extracted // would be the "extracted" part
  });
```

## Example
```css
.wix-tpa {
	color: {{color-1}};
	margin-left: 10px;
}
```
```css
// remain
.wix-tpa {
  margin-left: 10px;
}
```
```css
// extracted
.wix-tpa {
  color: {{color-1}};
}
```

## Testing

```
$ npm test
```

See [PostCSS] docs for examples for your environment.

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