css-builder
Build CSS in Javascript, no preprocessors!
Last updated 12 years ago by jaz303 .
MIT · Repository · Original npm · Tarball · package.json
$ cnpm install css-builder 
SYNC missed versions from official npm registry.

css-builder

Build CSS in Javascript!

Example

var builder = require('css-builder');

var b = builder();

b.rule('div.foo', function() {
    b.rule('a', function() {
        b.rule('&.red', {backgroundColor: 'red'});
        b.rule('&.blue', {backgroundColor: 'blue'});
    });
});

console.log(b.toString());

// =>
// div.foo a.red { background-color: red; }
// div.foo a.blue { background-color: blue; }

Options

  • append: function called to append CSS to buffer. If you override this, the builder's toString() function will always return an empty string.
  • builder: base builder object, to which attrib, attribs, rule and commit methods will be added. Defaults to empty object. Allows you to pass in your own object/prototype chain, possibly including macro functions for defining more complex rules.

Current Tags

  • 0.0.7                                ...           latest (12 years ago)

7 Versions

  • 0.0.7                                ...           12 years ago
  • 0.0.6                                ...           12 years ago
  • 0.0.5                                ...           12 years ago
  • 0.0.4                                ...           12 years ago
  • 0.0.3                                ...           12 years ago
  • 0.0.2                                ...           12 years ago
  • 0.0.1                                ...           12 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (0)
None
Dev Dependencies (0)
None
Dependents (1)

Copyright 2013 - present © cnpmjs.org | Home |