/web-fonts

PostCSS web font injector (PostCSS plugin). [Library, CSS, PostCSS]

Primary LanguageJavaScriptGNU General Public License v3.0GPL-3.0

web-fonts

PostCSS web font injector (PostCSS plugin)

Installation

npm i web-fonts

Usage

const postcss = require('postcss');
const webfonts = require('web-fonts');

const specification = {
  import: "url('https://fonts.googleapis.com/css?family=Roboto')",
  family: "'Roboto', sans-serif",
  selector: 'html, input, button',
};

postcss([ precss, webfonts(specification) ]).process...

Developers

Options object example.

{
  import: "url('https://fonts.googleapis.com/css?family=Roboto')",
  family: "'Roboto', sans-serif",
  selector: 'html, input, button',
}