Skip to content

Latest commit

 

History

History
41 lines (28 loc) · 1.06 KB

README.md

File metadata and controls

41 lines (28 loc) · 1.06 KB

chance-font

semantic-release npm Build Status

What is this?

A library to return a random font stack from a list provided by the W3C.

Why should I use this?

You want a random font.

Installation

yarn add chance-font

Usage

import chanceFont from "chance-font";

document.body.innerHTML = `
  <div style="font-family: ${chanceFont()};">
    A real degree of freedom
  </div>
`;

You can also specify the type of font you want:

chanceFont('all'); // default
chanceFont('sans');
chanceFont('serif');
chanceFont('monospace');
chanceFont('cursive');
chanceFont('fantasy');