dzucconi / chance-font

A real degree of freedom

Home Page:https://dzucconi.github.io/chance-font/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

About

A real degree of freedom

https://dzucconi.github.io/chance-font/


Languages

Language:JavaScript 76.5%Language:HTML 15.8%Language:CSS 7.6%