https://github.com/manovotny/chance-class-name
A Chance.js mixin to generate class names.
https://github.com/manovotny/chance-class-name
chance chancejs class classname mixin name
Last synced: about 1 year ago
JSON representation
A Chance.js mixin to generate class names.
- Host: GitHub
- URL: https://github.com/manovotny/chance-class-name
- Owner: manovotny
- License: mit
- Created: 2017-07-25T20:51:24.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2019-09-08T23:12:18.000Z (almost 7 years ago)
- Last Synced: 2025-06-03T09:16:49.205Z (about 1 year ago)
- Topics: chance, chancejs, class, classname, mixin, name
- Language: JavaScript
- Homepage:
- Size: 104 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# chance-class-name [](https://travis-ci.org/manovotny/chance-class-name)
> A [Chance.js mixin](http://chancejs.com/#mixin) to generate class names.
Class names are generated according the [W3C CSS spec](https://stackoverflow.com/a/449000).
## Install
### NPM
```
$ npm i chance-class-name
```
### Yarn
```
$ yarn add chance-class-name
```
## Usage
```js
import Chance from 'chance';
import className from 'chance-class-name';
const chance = new Chance();
chance.mixin({
className
});
chance.className();
```
By default, `chance-class-name` will return a randomly generated class name.
Class names will be between 1 and 25 characters long.
Example: `M-oYLdbPVMpbhjGrsLH`
## License
MIT © [Michael Novotny](http://manovotny.com)