Ninja Parading Musically
    Share your code. npm Orgs help your team discover, share, and reuse code. Create a free org »

    css-prettifierpublic

    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.

    Keywords

    install

    npm i css-prettifier

    Downloadsweekly downloads

    16

    version

    0.1.6

    license

    none

    repository

    githubgithub

    last publish

    collaborators

    • avatar