Skip to content

dzucconi/chance-font

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

35 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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');