https://github.com/matype/css-utilify
Add `@base` annotations to the rules
https://github.com/matype/css-utilify
Last synced: 12 months ago
JSON representation
Add `@base` annotations to the rules
- Host: GitHub
- URL: https://github.com/matype/css-utilify
- Owner: matype
- License: other
- Created: 2015-05-18T02:39:21.000Z (about 11 years ago)
- Default Branch: master
- Last Pushed: 2015-07-01T03:27:10.000Z (about 11 years ago)
- Last Synced: 2025-07-18T17:40:49.411Z (about 1 year ago)
- Language: JavaScript
- Size: 129 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.markdown
- Changelog: changelog.markdown
- License: license
Awesome Lists containing this project
README
# css-utilify [](https://travis-ci.org/morishitter/css-utilify)
Add `@base` annotations to the rules.
Using with [AtCSS](https://github.com/morishitter/atcss) or [postcss-include](https://github.com/morishitter/postcss-include).
## Install
```shell
$ npm install css-utilify
```
## Usage
### CLI
```
$ css-utilify input-file (output-file-name)
```
Default `output-file-name` is `input-file.base.css`.
### in PostCSS
```js
var fs = require('fs')
var postcss = require('postcss')
var utilify = require('postcss-utilify')
var css = fs.readFileSync('input.css', 'utf-8')
var output = postcss(css)
.use(utilify)
.process(css)
.css
```
Using this `input.css`:
```css
.fl {
float: left;
}
.pdt-10 {
padding-top: 10px;
}
```
You will get:
```css
.fl {
/* @base */
float: left;
}
.pdt-10 {
/* @base */
padding-top: 10px;
}
```
## License
The MIT License (MIT)
Copyright (c) 2015 Masaaki Morishita