A library to return a random font stack from a list provided by the W3C.
You want a random font.
yarn add chance-font
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');