PostCSS plugin Split up and filter a ruleset.
.themed .selector .for .any .element {
margin: 0;
color: #ffffff;
}
.for .any .element {
margin: 0;
}
.themed .selector .for .any .element {
color: #ffffff;
}
Usage
module.exports = {
plugins: {
'postcss-split-up-by-rules': {
listenFor: ['.themed .selector'],
extract: ['color', 'background-color']
},
},
};
See PostCSS docs for examples for your environment.