0.0.3 • Published 3 years ago

postcss-plugin-namespace v0.0.3

Weekly downloads
152
License
MIT
Repository
github
Last release
3 years ago

PostCSS Plugin Namespace Build Statusnpmnpm

PostCSS A PostCSS plugin that could add css selector before all selectors,so that the styles will not affect other projects.

Usage

passed a css selector as the first argument;

postcss([ require('postcss-plugin-namespace')('.insert-selector') ])

input

.foo {
    /* Input example */
}

output

.insert-selector .foo {
  /* Output example */
}

Options

Pass an options object as the second argument.

options.ignore

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.