# css-builder

> Build CSS in Javascript, no preprocessors!

Latest version **0.0.7** (published 2013-12-24) · MIT license · 0 weekly downloads

## Install

```sh
npm install css-builder
pnpm add css-builder
yarn add css-builder
bun add css-builder
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.7 |
| Published | 2013-12-24 |
| First published | 2013-11-27 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 2 |
| Author | Jason Frame |
| Maintainers | jaz303 |
| Keywords | css, generate, builder |

## Links

- npm: https://www.npmjs.com/package/css-builder
- Repository: https://github.com/jaz303/css-builder
- Issues: https://github.com/jaz303/css-builder/issues
- npm.io page: https://npm.io/package/css-builder

## Alternatives

- [style-dictionary](https://npm.io/package/style-dictionary.md) — 2.0M weekly downloads
- [postcss-merge-idents](https://npm.io/package/postcss-merge-idents.md) — 1.7M weekly downloads
- [@fontsource/noto-sans](https://npm.io/package/@fontsource/noto-sans.md) — 93.0K weekly downloads
- [uglifycss](https://npm.io/package/uglifycss.md) — 71.6K weekly downloads
- [mat4-interpolate](https://npm.io/package/mat4-interpolate.md) — 23.3K weekly downloads

## Recent versions

- 0.0.7 (latest) — 2013-12-24
- 0.0.6 — 2013-12-24
- 0.0.5 — 2013-12-24
- 0.0.4 — 2013-12-24
- 0.0.3 — 2013-12-24
- 0.0.2 — 2013-11-27
- 0.0.1 — 2013-11-27

## README

# 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.

---
_Source: https://npm.io/package/css-builder · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
