PostCSS plugin that extracts styles from css based on deceleration matching.
pattern
: Regex | Array
const options = {
pattern: /{{[^\}]+}}/g
};
postcss([ require('postcss-extract-styles')(options) ]
.then((result) => {
result.css // will be the "remain" part
result.extracted // will be the "extracted" part
});
.wix-tpa {
color: {{color-1}};
margin-left: 10px;
}
// remain
.wix-tpa {
margin-left: 10px;
}
// extracted
.wix-tpa {
color: {{color-1}};
}
$ npm test
See PostCSS docs for examples for your environment.