Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/andrepolischuk/postcss-color-short
PostCSS plugin for color shortcuts
https://github.com/andrepolischuk/postcss-color-short
color postcss postcss-plugin
Last synced: 6 days ago
JSON representation
PostCSS plugin for color shortcuts
- Host: GitHub
- URL: https://github.com/andrepolischuk/postcss-color-short
- Owner: andrepolischuk
- License: mit
- Created: 2015-07-31T13:42:17.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2017-04-24T11:38:47.000Z (over 7 years ago)
- Last Synced: 2024-10-28T14:16:32.873Z (17 days ago)
- Topics: color, postcss, postcss-plugin
- Language: JavaScript
- Homepage:
- Size: 11.7 KB
- Stars: 12
- Watchers: 4
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# postcss-color-short [![Build Status][travis-image]][travis-url]
> [PostCSS][postcss] plugin for color shortcuts
For hexadecimal, rgb and rgba
```css
/* before */.hello {
border-bottom: 1px solid rgb(200);
background: #20;
color: #f;
box-shadow: 0 1px 5px rgba(0, 0.5);
}/* after */
.hello {
border-bottom: 1px solid rgb(200, 200, 200);
background: #202020;
color: #fff;
box-shadow: 0 1px 5px rgba(0, 0, 0, 0.5);
}
```## Install
```sh
npm install --save-dev postcss-color-short
```## Usage
### PostCSS
```js
var fs = require('fs');
var postcss = require('postcss');
var colorShort = require('postcss-color-short');
var css = fs.readFileSync('input.css', 'utf8');var output = postcss([colorShort])
.process(css)
.css;
```### Gulp
```js
var gulp = require('gulp');
var postcss = require('gulp-postcss');
var colorShort = require('postcss-color-short');gulp.task('css', function () {
return gulp.src('./src')
.pipe(postcss([
colorShort
]))
.pipe(gulp.dest('./dist'));
});
```## License
MIT
[travis-url]: https://travis-ci.org/andrepolischuk/postcss-color-short
[travis-image]: https://travis-ci.org/andrepolischuk/postcss-color-short.svg?branch=master[postcss]: https://github.com/postcss/postcss