1.0.0 • Published 9 years ago
postcss-times v1.0.0
postcss-times
Install
npm i postcss-timesUsage
Write css.
#id:times(2) {}
.class:times(3) {}
.parent .child:times(2) {}
.parent .child.multi:times(2) {}
[attr=class]:times(2) {}
[attr^=class]:times(2) {}
[attr$=class]:times(2) {}
[attr="class"]:times(2) {}
#id:times(str) {}Transform
const fs = require('fs');
const postcss = require('postcss');
const times = require('postcss-times');
const css = fs.readFileSync('./sample.css', 'utf-8');
postcss([times])
.process(css)
.then(result => console.log(result.css));Output
Get like this.
#id#id {}
.class.class.class {}
.parent .child.child {}
.parent .child.multi.multi {}
[attr=class][attr=class] {}
[attr^=class][attr^=class] {}
[attr$=class][attr$=class] {}
[attr="class"][attr="class"] {}
#id {}Run to example
1 Clone this
git clone git@github.com:totora0155/postcss-times.git2 Change directory
cd postcss-times3 Install modules
npm install4 Run to script
cd examples && node postcss.jsChange log
| version | log |
|---|---|
| 1.0.0 | Rewrite es6 |
| 0.0.1 | Release! |
1.0.0
9 years ago