Kevin 29b9a0c50c clean && clean html base | 4 years ago | |
---|---|---|
.. | ||
node_modules | 4 years ago | |
LICENSE | 4 years ago | |
README.md | 4 years ago | |
index.js | 4 years ago | |
package.json | 4 years ago |
CSS Beautify automatically formats your style to be consistent and easy to read
Given the following style:
.menu{color:red} .navigation{background-color:#333}
CSS Beautify will produce:
.menu {
color: red
}
.navigation {
background-color: #333
}
Install with npm
npm install --save-dev gulp-cssbeautify
var gulp = require('gulp'),
cssbeautify = require('gulp-cssbeautify');
gulp.task('css', function() {
return gulp.src('./styles/*.css')
.pipe(cssbeautify())
.pipe(gulp.dest('./styles/'));
});
With options:
var gulp = require('gulp'),
cssbeautify = require('gulp-cssbeautify');
gulp.task('css', function() {
return gulp.src('./styles/*.css')
.pipe(cssbeautify({
indent: ' ',
openbrace: 'separate-line',
autosemicolon: true
}))
.pipe(gulp.dest('./styles/'));
});
Type: String
Default: ' '
Spaces to use for indentation.
Type: String
Default: end-of-line
Values: end-of-line
, separate-line
Defines the placement of open curly brace.
Type: Boolean
Default: false
Always inserts a semicolon after the last ruleset.
MIT © Jonathan Kemp