# suitcx

> It's classnames, wearing a suit.

Latest version **0.1.2** (published 2016-08-08) · Unlicense license · 0 weekly downloads

## Install

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

## 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.1.2 |
| Published | 2016-08-08 |
| First published | 2016-08-08 |
| Weekly downloads | 0 |
| License | Unlicense |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Jim O'Brien |
| Maintainers | jimmed |
| Keywords | utility, util, classnames, classname, classes, css, react, style, suitcss, css-utilities, css-components, browser |

## Links

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

## Dependencies (1)

- [classnames](https://npm.io/package/classnames.md) ^2.2.5

## 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.1.2 (latest) — 2016-08-08
- 0.1.1 — 2016-08-08
- 0.1.0 — 2016-08-08

## README

# suitcx
It's like [`classnames`][classnames], but for [SuitCSS][suitcss] components.

## Example

```js
// returns 'ChatMessage ChatMessage--unread'
suitcx('ChatMessage', { unread: true })
```

```js
// returns 'Button Button--colorPrimary Button--hollow
suitcx('Button', { color: 'primary', hollow: true })
```

```js
// returns 'Panel Panel--anchorTop is-active'
suitcx('Panel', { anchor: 'top' }, { active: true })
```

## Parameters

### `parent` (string)

The base SuitCSS class name to use. For example, `ChatMessage` or `Modal-header`.

### `modifiers` (object, optional)

An optional object representing the SuitCSS modifiers to apply.

For each key/value pair of the object:

- if the value is a string, then the modifier applied will be composed of the key and value, camel-cased together,
- otherwise, if the value is truthy, then the key will be used as the modifier name.

For example, the following `modifiers` parameter results in the modifiers, `alignLeft`, `colorDarkBlue` and `hollow` to be applied:

```js
{
  align: 'left',
  color: 'darkBlue',
  hollow: true,
  rounded: false
}
```

### `state` (object, optional)

An optional object representing the SuitCSS state to apply.

For each key/value pair of the object, if the value is truthy, then the key will be applied as the state.

For example, the following `state` parameter results in the state `is-active is-hovered` to be applied:

```js
{
  active: true,
  hovered: true,
  pressed: false
}
```

[classnames]: https://www.npmjs.com/package/classnames
[suitcss]: https://www.npmjs.com/package/suitcss

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