postcss-remote-font-inliner

A postcss plugin for inlining remote fonts

Usage no npm install needed!

<script type="module">
  import postcssRemoteFontInliner from 'https://cdn.skypack.dev/postcss-remote-font-inliner';
</script>

README

PostCSS Remote Font Inliner

I had a very specific use case for base64 inlining hosted fonts (in my case Google). All this plugin does is look for font-face src declarations with http(s) urls, downloads the fonts, base64 encodes them, and inlines them.

It works very well with Font Magician.

Usage

Simply include it in your postcss pipeline:

postcss([
   require('postcss-remote-font-inliner')()
]).process(
   fs.readFileSync('./css/src/style.css', 'utf8')
).then(function (result) {
   fs.writeFileSync('./css/style.css', result.css);
});

Options

Currently, there are none.

License

MIT