https://github.com/calvin-ll/custom-ident
format strings to css `<custom-ident>`s
https://github.com/calvin-ll/custom-ident
css view-transitions view-transitions-api
Last synced: 2 months ago
JSON representation
format strings to css `<custom-ident>`s
- Host: GitHub
- URL: https://github.com/calvin-ll/custom-ident
- Owner: Calvin-LL
- License: mit
- Created: 2025-07-01T06:39:22.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2025-07-01T08:06:23.000Z (about 1 year ago)
- Last Synced: 2025-07-01T08:07:06.470Z (about 1 year ago)
- Topics: css, view-transitions, view-transitions-api
- Language: TypeScript
- Homepage:
- Size: 1.95 KB
- Stars: 1
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# 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 [``](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'
```