# cssobjectify

> Browserify/dcompose transform to convert CSS into an JSON object

Latest version **0.2.1** (published 2014-01-22) · MIT license · 0 weekly downloads

## Install

```sh
npm install cssobjectify
pnpm add cssobjectify
yarn add cssobjectify
bun add cssobjectify
```

## 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.2.1 |
| Published | 2014-01-22 |
| First published | 2013-10-31 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 3 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 39 |
| Author | Andrey Popp |
| Maintainers | andreypopp |
| Keywords | browserify, browserify-transform, dcompose, dgraph, css, json, react |

## Links

- npm: https://www.npmjs.com/package/cssobjectify
- Repository: https://github.com/andreypopp/cssobjectify
- Issues: https://github.com/andreypopp/cssobjectify/issues
- npm.io page: https://npm.io/package/cssobjectify

## Dependencies (3)

- [through](https://npm.io/package/through.md) ~2.3.4
- [css-parse](https://npm.io/package/css-parse.md) ~1.6.0
- [to-camel-case](https://npm.io/package/to-camel-case.md) ~0.2.0

## Alternatives

- [@mapbox/jsonlint-lines-primitives](https://npm.io/package/@mapbox/jsonlint-lines-primitives.md) — 5.3M weekly downloads
- [reftools](https://npm.io/package/reftools.md) — 3.5M weekly downloads
- [@hey-api/openapi-ts](https://npm.io/package/@hey-api/openapi-ts.md) — 3.5M weekly downloads
- [@mapbox/geojson-rewind](https://npm.io/package/@mapbox/geojson-rewind.md) — 2.4M weekly downloads
- [turbo-stream](https://npm.io/package/turbo-stream.md) — 1.7M weekly downloads

## Recent versions

- 0.2.1 (latest) — 2014-01-22
- 0.2.0 — 2013-11-02
- 0.1.1 — 2013-10-31
- 0.1.0 — 2013-10-31

## README

# cssobjectify

Source transform for [browserify][browserify] or [dcompose][dcompose] which
converts CSS into JSON objects which can be used further by libraries like
[React][React] to assign styles to UI components.

`styles.css`:

    MyComponent {
      font-size: 12px;
      background-color: red;
    }

`myapp.js`:

    var React = require('react-tools/build/modules/React');
    var Styles = require('./styles.css');

    var MyComponent = React.createClass({
      render: function() {
        return (
          <div style={Styles.MyComponent}>
            Hello, world!
          </div>
        )
      }
    });

## Usage

Use npm to install the package:

    % npm install cssobjectify

And use it with browserify:

    % browserify -t cssobjectify ./myapp.js

where `./myapp.js` or its dependencies can reference `*.css` files by
`require(...)` calls.

[browserify]: http://browserify.org
[dcompose]: https://github.com/andreypopp/dcompose
[React]: http://facebook.github.io/react/

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