https://github.com/nju33/postcss-times
PostCSS plugin that to use instead of !important
https://github.com/nju33/postcss-times
postcss-plugins
Last synced: about 1 year ago
JSON representation
PostCSS plugin that to use instead of !important
- Host: GitHub
- URL: https://github.com/nju33/postcss-times
- Owner: nju33
- License: mit
- Created: 2015-12-01T14:55:11.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2016-06-30T06:12:19.000Z (over 9 years ago)
- Last Synced: 2024-11-22T12:13:21.958Z (over 1 year ago)
- Topics: postcss-plugins
- Language: JavaScript
- Homepage:
- Size: 6.84 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# postcss-times
[](https://badge.fury.io/js/postcss-times)
[](https://travis-ci.org/totora0155/postcss-times)
[](https://github.com/sindresorhus/xo)
PostCSS plugin that to use instead of !important
---
## Install
```
npm i postcss-times
```
## Usage
Write css.
```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
```javascript
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.
```css
#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.git
```
**2** Change directory
```
cd postcss-times
```
**3** Install modules
```
npm install
```
**4** Run to script
```
cd examples && node postcss.js
```
## Change log
|version|log|
|:-:|:--|
|1.0.0|Rewrite es6|
|0.0.1|Release!|