PostCSS web font injector (PostCSS plugin)
npm i web-fonts
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...
Options object example.
{
import: "url('https://fonts.googleapis.com/css?family=Roboto')",
family: "'Roboto', sans-serif",
selector: 'html, input, button',
}