Automattic / juice

Juice inlines CSS stylesheets into your HTML source.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Issue with <link> tags using data-embed

TurboTodd2k opened this issue · comments

Not sure if I'm misunderstanding but I'm attempting to bring an external style sheet in and not inline the css as it's for client hacks. Based on the documentation I'm using

<link rel="stylesheet" type="text/css" href="assets/css/email-client-base.css" data-embed>

Unfortunately the behavior I'm seeing is that the code is inlined. Since no one else is talking about this it must be my code. Anything obviously wrong in what I'm doing?

This is on Grunt 1.0.1 btw...

TIA for any thoughts.

I'm not sure offhand, if you can reproduce on runkit, that would be really useful https://runkit.com/npm/juice

I'm seeing the same behaviour. Only code inside media queries appears to be being preserved.

Our current options array looks like this
var juiceOptions = { preserveMediaQueries: true, applyAttributesTableElements: true, applyWidthAttributes: true, preserveImportant: true, preserveFontFaces: true, webResources: { images: false } }

closing as stale

commented

@TurboTodd2k I think you should add data-inline next to data-embed.

Read docs. carefully:

... present on a stylesheet that has been inlined into the document as a <style></style> tag by the web-resource-inliner ...