Open wgordon17 opened 6 years ago
Basically, the problem is that the declaration that you pass within the style attribute is more generic (I think), than those declared on your stylesheet. For example, if you change margin: 25px auto
to margin-top: 25px; margin-bottom: 25px; margin-left: auto; margin-right: auto;
you won't have any problem and those specific declarations won't make it into the final code.
I would normally agree with you, however this worked as I had outlined above in v1 of the inliner. So this seems more like a regression as opposed to expected behavior.
I would provide comparison output, but v1 of the online inliner is returning Failed to load https://zurb.com/ink/skate-proxy.php: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'https://foundation.zurb.com' is therefore not allowed access. The response had HTTP status code 403.
when converting an email.
Unfortunately I haven't had any experience with v1, but I agree, though at the same time I can understand the thinking behind this feature (though it might be just a bug). Foundation, from the looks of it, inlines everything overwriting any exact declarations with those that have higher specificity. Now what happens with shorthand declarations when confronted by their elements. Let's reverse your example: margin: 25px auto
in stylesheet and margin-top: 16px
in the style attribute. In order for what you are proposing to work Foundation would have to break down the shorthand into 4 elements and rewrite the top element which would leave 4 elements inside, thus increasing the newsletter body. I would prefer smaller code and being more specific when I need to overwrite something. Though maybe foundation has the feature and the complier can break down the shorthand and then reconstruct it again (trying to keep the html as short as possible). And it just isn't working. 🤷🏼♂️
How can we reproduce this bug?
Write out the HTML (or Inky code) that causes the issue.
What did you expect to happen?
This block has
margin: 25px auto
specified on the element, even though.content-td .intercom-container
has amargin-bottom: 16px
specified. Themargin-bottom: 16px
should have not made it into the compiled code since it's overriden on the element.What happened instead?
margin: 25px auto
andmargin-bottom: 16px
both got applied to the element, andmargin-bottom: 16px
overrode the margin.What email clients does this happen in? All