Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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: 1 day 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 (about 7 years ago)
- Default Branch: master
- Last Pushed: 2019-09-08T23:12:18.000Z (about 5 years ago)
- Last Synced: 2024-09-15T13:34:50.816Z (18 days ago)
- Topics: chance, chancejs, class, classname, mixin, name
- Language: JavaScript
- Homepage:
- Size: 104 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# chance-class-name [![Build Status](https://travis-ci.org/manovotny/chance-class-name.svg?branch=master)](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)