0.2.2 • Published 1 year ago

css-mixer v0.2.2

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

css-mixer

Minimal 226 bytes CSS class & id joiner written in TypeScript.

Inspired by clsx & classnames.

Installation

npm i css-mixer

Usage

JSX

Code:

import mixer from 'css-mixer';

//...
const isCapibara = true;
const isPokemon = false;

return <div
    id={isCapibara && 'capibara', isPokemon && 'pokemon'}
    className={mixer('foo', {bar: true, pub: false}, ['fizz', 'buzz'])}
/>;
//...

Outcome (html):

<div id="capibara" class="foo bar fizz buzz"></div>

JS

const mixer = require('css-mixer');

console.log(
    mixer('a', true && 'b', false && 'c', ['d', 'e'], {f: true, g: false})
);
// output: 'a b d e f'
0.2.2

1 year ago

0.2.1

1 year ago

0.2.0

1 year ago

0.1.1

1 year ago

0.1.0

1 year ago

0.1.0-beta.0

1 year ago