custom-ident
Version:
Generate css `<custom-ident>`s
41 lines (29 loc) • 945 B
Markdown
# custom-ident
[](https://www.npmjs.com/package/custom-ident)
[](https://github.com/Calvin-LL/custom-ident/blob/main/LICENSE)
[](https://www.npmjs.com/package/custom-ident)
Generate css [`<custom-ident>`](https://developer.mozilla.org/en-US/docs/Web/CSS/custom-ident)s
## Install
```bash
npm install custom-ident
```
## Usage
### Basic
```js
import { customIdent } from "custom-ident";
const ident = customIdent("foo", "bar", "baz@");
console.log(ident); // 'foo_bar_baz\\40'
```
### Non-string values
```js
import { customIdent } from "custom-ident";
const ident = customIdent([
undefined,
null,
true,
false,
3,
{ test: "hi", oof: 0 },
]);
console.log(ident); // 'undefined_null_true_false_3_test'
```