postcss-extract-styles

1.2.0 • Public • Published

PostCSS Extract Styles Build Status npm

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

Options

pattern : Regex | Array

Usage

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

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

Testing

$ npm test

See PostCSS docs for examples for your environment.

Package Sidebar

Install

npm i postcss-extract-styles

Weekly Downloads

23

Version

1.2.0

License

MIT

Unpacked Size

4.42 kB

Total Files

6

Last publish

Collaborators

  • felixmosh