Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

css-whitespace

reworkcss3.4k1.1.1

Whitespace significant CSS to regular CSS

css, parser, rework

readme

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
$ component install visionmedia/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
  color: white

form
  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;
  color: white;
}

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

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

License

MIT

changelog

1.1.1 / 2015-02-23

  • update debug dep

1.1.0 / 2013-06-02

  • add component support
  • add support for regular css multi-line comments. Closes #12
  • add stripping of blank lines. Closes #14
  • remove blank() from lexer

1.0.0 / 2013-02-27

  • fix & support with comma-delimited selectors

0.0.6 / 2013-02-20

  • fix :fullscreen support

0.0.5 / 2013-01-21

  • fix @fontface support

0.0.4 / 2012-12-03

  • fix vendor pseudos

0.0.3 / 2012-12-03

  • fix complex media query support

0.0.2 / 2012-12-03

  • fix :before / :after

0.0.1 / 2010-01-03

  • Initial release