postcss-container

0.1.1 • Public • Published

PostCSS Container

Build status Test coverage Downloads

PostCSS plugin that adds a user input scope to each selector. for a command line interface.

Example input

.foo.boo h1 {
    /* declarations */
}
 
{
    /* declarations */
}

Example output scopify('#scope')

#scope .foo#scope .boo h1 {
    /* declarations */
}
 
#scope {
    /* declarations */
}

Installation

npm install postcss-cotaniner

Usage

var fs                 = require('fs');
var postcss            = require('postcss');
var postcssContainer   = require('postcss-container');
 
var css = fs.readFileSync('css/my-file.css', 'utf8').toString();
var out = postcss()
          .use(postcssContainer('#scope'))
          .process(css)
          .css;

You can use PostCSS with your build tool. Note there are plugins for Grunt, Gulp, webpackBroccoli, Brunch and ENB. See PostCSS docs for examples for your environment.

Package Sidebar

Install

npm i postcss-container

Weekly Downloads

2

Version

0.1.1

License

MIT

Unpacked Size

6.73 kB

Total Files

6

Last publish

Collaborators

  • techhtml