postcss-namespace
PostCSS plugin that prefix a namespace to a selector
Install
npm i postcss-namespace
Usage
Write @prefix
atrule to your css file.
(e.g. input.css)
@//); @ @&[ {}
Use this plugin in PostCSS (e.g.)
const fs = ;const postcss = ;const namespace = ; const css = fs; // or postcss([namespace.bem]) ;
Will get output
like following CSS
&[ {}
AtRule Function
not
(string|regexp)...
Specify selector or pattern which Don't want a prefix
Plugin Function
namespace.bem
Same asnamespace({token: '__'})
Options
token
Token for consolidate(e.g.)namespace({token: '__'})
-
by default
Run to example
1 Close this
git clone git@github.com:totora0155/postcss-namespace.git
2 Change directory
cd postcss-namespace
3 Install modules
npm install
4 Run to script
cd examples && node postcss.js
Change log
version | log |
---|---|
1.1.0 | Add bem function. (Alias {token: '__'} ) |
1.0.1 | Fix node.nodes |
1.0.0 | Rewrite with es2015 & Add not func in AtRule |
0.2.5 | Bug fix for :nth* selector & Revert v0.2.2 |
0.2.4 | Bug fix for pseudo selector |
0.2.3 | Bug fix (Tag not output after atrule) |
0.2.2 | Fix, occured error to postcss-selector-not syntax |
0.2.0 | Change at-rule keyword to @prefix from @namespace #1 |