Skip to Content

googleFont()

Loads fonts from Google Fonts.

googleFont(name: string, widths?: number | number[], subsets?: string | string[])

Example

nano.googleFont('Roboto Slab', [400, 700], 'cyrillic');

Then use it:

const className = nano.rule({ fontFamily: '"Roboto Slab", sans', });

Installation

import { addon as addonGoogleFont } from 'nano-css/addon/googleFont'; addonGoogleFont(nano);
Last updated on