Automattic / juice

Juice inlines CSS stylesheets into your HTML source.
MIT License
3.09k stars 220 forks source link

Quick question on embedding a font as base64 #197

Open dderiso opened 8 years ago

dderiso commented 8 years ago

Cheers Automattic,

Thanks for the awesome library! I was wondering if there is a way to use juice (or if you have any other recommendations) to embed a font, such as font-awesome, inline as a base64 at the top of the page? Here is a relevant snippet (from http://stackoverflow.com/a/24549189/1438550):

@font-face {
    font-family: "p22-underground-1";
    font-style: normal;
    font-weight: 400;
    src: url("data:font/opentype;base64,d09GRk9...yn4b8C3JEZAA==");
}

Thanks, Dave

niftylettuce commented 7 years ago

@dderiso see https://github.com/crocodilejs/custom-fonts-in-emails?

seyfer commented 2 years ago

@niftylettuce is not really useful if you already have a page or html/css from a big project. Probably if you create from scratch, then somehow you can apply custom-fonts-in-emails to each text and transform it to images, this is what this lib does. But for an already existing project, we just need @font-face { to work from css.