https://github.com/csstools/postcss-commas
Declare multiple, comma-separated properties
https://github.com/csstools/postcss-commas
Last synced: 11 months ago
JSON representation
Declare multiple, comma-separated properties
- Host: GitHub
- URL: https://github.com/csstools/postcss-commas
- Owner: csstools
- License: other
- Archived: true
- Created: 2016-04-28T01:47:14.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2021-11-07T21:26:15.000Z (over 4 years ago)
- Last Synced: 2025-04-21T21:40:13.760Z (11 months ago)
- Language: JavaScript
- Size: 5.86 KB
- Stars: 6
- Watchers: 4
- Forks: 3
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- License: LICENSE.md
Awesome Lists containing this project
README
# PostCSS Commas
[![NPM Version][npm-img]][npm] [![Build Status][ci-img]][ci]
[PostCSS Commas] allows you to declare multiple, comma-separated properties in CSS.
```css
/* before */
.foo {
position: absolute;
top, left: 0;
margin, padding: 1em;
}
/* after */
.foo {
position: absolute;
top: 0;
left: 0;
margin: 1em;
padding: 1em;
}
```
## Usage
Add [PostCSS Commas] to your build tool:
```bash
npm install postcss-commas --save-dev
```
#### Node
```js
require('postcss-commas').process(YOUR_CSS);
```
#### PostCSS
Add [PostCSS] to your build tool:
```bash
npm install postcss --save-dev
```
Load [PostCSS Commas] as a PostCSS plugin:
```js
postcss([
require('postcss-commas')()
]).process(YOUR_CSS);
```
#### Gulp
Add [Gulp PostCSS] to your build tool:
```bash
npm install gulp-postcss --save-dev
```
Enable [PostCSS Commas] within your Gulpfile:
```js
var postcss = require('gulp-postcss');
gulp.task('css', function () {
return gulp.src('./src/*.css').pipe(
postcss([
require('postcss-commas')()
])
).pipe(
gulp.dest('.')
);
});
```
#### Grunt
Add [Grunt PostCSS] to your build tool:
```bash
npm install grunt-postcss --save-dev
```
Enable [PostCSS Commas] within your Gruntfile:
```js
grunt.loadNpmTasks('grunt-postcss');
grunt.initConfig({
postcss: {
options: {
use: [
require('postcss-commas')()
]
},
dist: {
src: '*.css'
}
}
});
```
[ci]: https://travis-ci.org/jonathantneal/postcss-commas
[ci-img]: https://img.shields.io/travis/jonathantneal/postcss-commas.svg
[npm]: https://www.npmjs.com/package/postcss-commas
[npm-img]: https://img.shields.io/npm/v/postcss-commas.svg
[Gulp PostCSS]: https://github.com/postcss/gulp-postcss
[Grunt PostCSS]: https://github.com/nDmitry/grunt-postcss
[PostCSS]: https://github.com/postcss/postcss
[PostCSS Commas]: https://github.com/jonathantneal/postcss-commas