grubersjoe / typeface-public-sans

npm package to self-host the typeface Public Sans

Home Page:https://grubersjoe.github.io/typeface-public-sans/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Typeface Public Sans

This package has been archived since it is has been integrated into the central Typeface project.

The CSS and web font files to easily self-host Public Sans. This package is inspired by the effort of Kyle Mathews to create npm packages for all typefaces to improve font loading performance.

Install

npm install --save typeface-public-sans

Usage

This package assumes you’re using webpack to process CSS and font files. Each typeface package includes all font files for modern browsers (WOFF2 and WOFF) and a CSS file with font-face declarations pointing at these files.

You will need to have webpack or a different bundler setup to load css and font files. Many tools built with Webpack will work out of the box with Typefaces such as Create React App and Gatsby.

Simply require the package in your project’s entry file:

// Load the Public Sans typeface
import 'typeface-public-sans';

Rebuilding the CSS file

The font-face declarations are generated by a small script which extracts font weight and style from the font's filename. Run npm run build (or yarn build) to recreate the index.css file.

About

npm package to self-host the typeface Public Sans

https://grubersjoe.github.io/typeface-public-sans/

License:SIL Open Font License 1.1


Languages

Language:CSS 80.1%Language:JavaScript 19.9%