PostCSS A PostCSS plugin that could add css selector before all selectors,so that the styles will not affect other projects.
passed a css selector as the first argument;
postcss([ require('postcss-plugin-namespace')('.insert-selector') ])
.foo {
/* Input example */
}
.insert-selector .foo {
/* Output example */
}
Pass an options object as the second argument.
Don't prefix specific classes or classes that match a regex.
var css = postcss([namespace('.test', { ignore: [ /body/, ".icon" ] })])
.process(inputCSS)
.then(results => {results.toString()});
See PostCSS docs for examples for your environment.