css-prettifier

0.1.6 • Public • Published

CSS Prettifier Build Status Dependencies update check badge

CSS prettifier in your style.

Sample

Node.js

var fs = require("fs");
var path = require("path");
var options = {
    decl: {
        before: '\n\t'
    },
    selectors: 'separateline'
};
var cssprettifier = require("../lib/css-prettifier");
var processor = cssprettifier(options);
var css = fs.readFileSync("before.css");
var result = processor.process(css, {
    map: true,
    from: "prefixer.css",
    to: "after.css"
});
 
 
fs.writeFileSync("after.css", result.css.trim());

Before execution css is:

pul {
  margin-bottom: 1em;
}
 
.lyt-column .unit {
  float: left;
  margin-right: 20px;
}
.lyt-column .unit.last-unit {
  margin-right: 0;
}

After execution css is:

p,
ul {
    margin-bottom: 1em;
}
 
.lyt-column .unit {
    float: left;
    margin-right: 20px;
}
.lyt-column .unit.last-unit {
    margin-right: 0;
}

Usage

Grunt.js

You can use the grunt-csspretty plugin for Grunt.js.

gulp.js

You can use the gulp-csspretty plugin for gulp.js.

Readme

Keywords

Package Sidebar

Install

npm i css-prettifier

Weekly Downloads

16

Version

0.1.6

License

none

Last publish

Collaborators

  • hideki_a