# classnameify

> Generate classname selectors for CSS components, works splendid together with e.g. React

Latest version **1.0.0** (published 2015-09-03) · MIT license · 0 weekly downloads

## Install

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

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.0 |
| Published | 2015-09-03 |
| First published | 2015-09-03 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 2 |
| Author | Joakim Carlstein |
| Maintainers | joakimbeng |
| Keywords | classname, css, react, selectors, generate, large scale, scaling |

## Links

- npm: https://www.npmjs.com/package/classnameify
- Repository: https://github.com/joakimbeng/classnameify
- Homepage: https://github.com/joakimbeng/classnameify#readme
- Issues: https://github.com/joakimbeng/classnameify/issues
- npm.io page: https://npm.io/package/classnameify

## Dependencies (2)

- [cngen](https://npm.io/package/cngen.md) ^1.0.0
- [assign-all](https://npm.io/package/assign-all.md) ^1.0.0

## Alternatives

- [mobx-react](https://npm.io/package/mobx-react.md) — 2.8M weekly downloads
- [rc-tree](https://npm.io/package/rc-tree.md) — 2.6M weekly downloads
- [@react-oauth/google](https://npm.io/package/@react-oauth/google.md) — 1.3M weekly downloads
- [@wagmi/connectors](https://npm.io/package/@wagmi/connectors.md) — 877.0K weekly downloads
- [vee-validate](https://npm.io/package/vee-validate.md) — 836.4K weekly downloads

## Recent versions

- 1.0.0 (latest) — 2015-09-03

## README

# classnameify

[![Build status][travis-image]][travis-url] [![NPM version][npm-image]][npm-url] [![js-xo-style][codestyle-image]][codestyle-url]

> Generate classname selectors for CSS components, works splendid together with e.g. React

## Why?

Generating classnames according to the contents of CSS declarations solves the biggest problem with large scale CSS, i.e. the fact that it cascades. See [`unistyle`](https://www.npmjs.com/package/unistyle) for how to use this in a scalable way.

## Installation

Install `classnameify` using [npm](https://www.npmjs.com/):

```bash
npm install --save classnameify
```

## Usage

### Module usage

```javascript
var classnameify = require('classnameify');

classnameify({
  myComponent: {
    color: '#FFF',
    fontSize: '10px'
  }
});
/*
 {
  '._e80a8a8': {
    color: '#FFF',
    fontSize: '10px'
  }
 }
*/
```

#### Usage together with e.g. React

Have a look at [`unistyle`](https://www.npmjs.com/package/unistyle) for how this fits together with [React](http://facebook.github.io/react/).


## API

### `classnameify(val)`

| Name | Type | Description |
|------|------|-------------|
| val | `Object|Array` | The CSS components to classnameify |

Returns: `Object`.

## License

MIT © Joakim Carlstein

[npm-url]: https://npmjs.org/package/classnameify
[npm-image]: https://badge.fury.io/js/classnameify.svg
[travis-url]: https://travis-ci.org/joakimbeng/classnameify
[travis-image]: https://travis-ci.org/joakimbeng/classnameify.svg?branch=master
[codestyle-url]: https://github.com/sindresorhus/xo
[codestyle-image]: https://img.shields.io/badge/code%20style-xo-brightgreen.svg?style=flat

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