Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/stephanhoyer/classies
Simple css class builder
https://github.com/stephanhoyer/classies
css
Last synced: 3 months ago
JSON representation
Simple css class builder
- Host: GitHub
- URL: https://github.com/stephanhoyer/classies
- Owner: StephanHoyer
- License: mit
- Created: 2017-09-23T21:27:40.000Z (over 7 years ago)
- Default Branch: next
- Last Pushed: 2024-09-02T18:48:56.000Z (4 months ago)
- Last Synced: 2024-10-14T12:56:37.401Z (3 months ago)
- Topics: css
- Language: JavaScript
- Size: 102 KB
- Stars: 10
- Watchers: 3
- Forks: 1
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- Changelog: changelog.md
- License: LICENSE
Awesome Lists containing this project
README
# classies
![Build Status](https://github.com/StephanHoyer/classies/actions/workflows/merge.yml/badge.svg)
[![Renovate](https://img.shields.io/badge/renovate-enabled-brightgreen.svg)](https://renovatebot.com)
![Compression](http://img.badgesize.io/StephanHoyer/classies/master/index.js.svg?compression=gzip)Simple css class string builder without shenanigans.
## install
```
npm install classies
```## usage
```js
const cls = require("classies");
const isSelected = true;let classString = cls(
{
foo: true,
bar: someCondition,
[classString]: true,
isSelected,
},
separator
); // separator defaults to ' '
```## perfomance
see [jsperf](https://jsperf.com/cls/1)
Latest version was done by [@isiahmeadows](https://github.com/isiahmeadows) and [@gamb](https://github.com/gamb).
If you have a better version, feel free to submit a PR.
## releases
Releases are automated by [pr-release](http://pr-release.org/)