Skip to content
Convert whitespace significant CSS to valid CSS
CSS JavaScript
Find file
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
examples
lib
test
.gitignore
.npmignore
History.md
Makefile
Readme.md
index.js
package.json

Readme.md

css-whitespace

Whitespace significant CSS to regular CSS. Typically used for Rework, however you may use it on its own if you like.

Installation

$ npm install css-whitespace

API

var compile = require('css-whitespace');
var css = compile('body\n  color: #888\n');

Example

@charset "utf-8"

@import "foo.css"

body
  padding: 50px
  background: black
  colour: white

button
  border-radius: 5px
  padding: 5px 10px

@media print
  body
    padding: 0

  button
    border-radius: 0
    width: 100%

yields:

@charset "utf-8";

@import "foo.css";

body {
  padding: 50px;
  background: black;
  colour: white;
}

button {
  border-radius: 5px;
  padding: 5px 10px;
}

@media print {
  body {
    padding: 0;
  }
  button {
    border-radius: 0;
    width: 100%;
  }
}

License

MIT

Something went wrong with that request. Please try again.