postcss-plugin-namespace

0.0.3 • Public • Published

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.

/postcss-plugin-namespace/

    Package Sidebar

    Install

    npm i postcss-plugin-namespace

    Weekly Downloads

    803

    Version

    0.0.3

    License

    MIT

    Unpacked Size

    5.54 kB

    Total Files

    6

    Last publish

    Collaborators

    • ymrdf