Skip to content

Automatically downloads and sets up font-face definitions for Google Fonts.

License

Notifications You must be signed in to change notification settings

kevmodrome/elderjs-plugin-google-fonts

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

elderjs-plugin-google-fonts

This plugin fetches fonts from google fonts, generates font-face definitions and inlines those in the head tag.

Usage

Simply install and add your config to elder.config.js. An example:

'elderjs-plugin-google-fonts': {
  fonts: {
    'Anton': ['400'],
    'Overpass': ['400', '700i'],
    'Inter': ['400'],
  },
  subsets: ['latin'],
}

Config

Name Descriptions Default
fonts Objects of fonts (key) to be downloaded in specified weights (value, Array) required
subsets DEPRECATED: Array of subsets to be downloaded []
swap Adds font-display: swap CSS property. Recommended by Pagespeed Insights. false
prefix Optional folder name where the files be saved to. Useful if you have a server prefix set in your Elder config. '/'

About

Automatically downloads and sets up font-face definitions for Google Fonts.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •