@idwise-public/postcss-scopify

0.1.10 • Public • Published

PostCSS Scopify

Build status Test coverage Downloads

PostCSS plugin that adds a user input scope to each selector. for a command line interface, see scopify-cli.

Example input

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

& {
    /* declarations */
}

Example output scopify('#scope')

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

#scope {
    /* declarations */
}

Installation

npm install postcss-scopify

Usage

var fs        = require('fs');
var postcss   = require('postcss');
var scopify   = require('postcss-scopify');

var css = fs.readFileSync('css/my-file.css', 'utf8').toString();
var out = postcss()
          .use(scopify('#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.

Change Log

v0.1.8

closes #10

v0.1.7

fixes #7

v0.1.5

closes #3

v0.1.4

fixes #4

Package Sidebar

Install

npm i @idwise-public/postcss-scopify

Weekly Downloads

1

Version

0.1.10

License

MIT

Unpacked Size

7.38 kB

Total Files

6

Last publish

Collaborators

  • tasniem
  • a.khan-idwise