Skip to content

A Chance.js mixin to generate class names.

License

Notifications You must be signed in to change notification settings

manovotny/chance-class-name

Repository files navigation

chance-class-name Build Status

A Chance.js mixin to generate class names.

Class names are generated according the W3C CSS spec.

Install

NPM

$ npm i chance-class-name

Yarn

$ yarn add chance-class-name

Usage

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