Created
May 6, 2017 10:33
-
-
Save chrishutchinson/4a9f7bffddfec376e9d71e8666d5955d to your computer and use it in GitHub Desktop.
Get the base64 version of a Google Font
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const googlefontcssmerge = require('googlefontcssmerge'); | |
const googlefontcss64 = require('googlefontcss64'); | |
const css = require('css'); | |
const url = `http://fonts.googleapis.com/css?family=Open+Sans`; | |
googlefontcssmerge(url, function(error, style) { | |
if (error) throw error; | |
googlefontcss64(style, function(error, style) { | |
if (error) throw error; | |
console.log(css.stringify(style)); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment