Skip to content

prevent inlineCSS from removing gmail iOS font inversion hack #563

Answered by cossssmin
moiseev-loona asked this question in Q&A
Discussion options

You must be logged in to vote

data-embed on the <style> tag is the right approach, at least for now (we also recommend it in the docs).

In order to remove redundant CSS we need to remove the <style> tag contents after inlining them, which basically removes everything except stuff in things like @media queries. Since the Juice CSS inliner doesn't have any selector 'safelist' or 'blocklist', using data-embed is the only way to do it cleanly.

Another approach would be to set removeStyleTags to false in the config, i.e.:

inlineCSS: {
	removeStyleTags: false,
},

... but then you'd also need to configure removeUnusedCSS to whitelist CSS selectors for stuff that doesn't actually exist in your HTML.

Note that you don't need p…

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by moiseev-loona
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants