New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

google-fonts

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

google-fonts

A small helper library for embedding Google Fonts on your page.

  • 1.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
2.2K
decreased by-18.53%
Maintainers
1
Weekly downloads
 
Created
Source

google-fonts experimental

google-fonts

A small helper library for embedding Google Fonts onto your page.

Usage

fonts(list)

Given a list of fonts (see below), returns a string like this one (minus the whitespace) that you can include in a template:

<link
  href='http://fonts.googleapis.com/css?family=Cantora+One|Ropa+Sans:400,400italic'
  rel='stylesheet'
  type='text/css'
>

fonts.add(list)

Given the same list of fonts, you can add them directly to your page using this method (assuming you're using something like browserify).

Useful for quick demos/prototypes, but if you want to avoid the flash of unstyled text then stick with pasting their snippet in your HTML.

The list should be formatted like so:

fonts.add({
    'Ropa Sans': ['400', '400italic']
  , 'Source Sans Pro': true
  , 'Raleway': 400
})

Where each key is a font name, and each value is an array of styles to include. You can also pass a single style, or true to include all of the available ones for that font.

Keywords

FAQs

Package last updated on 01 Feb 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc