Open drgrieve opened 1 month ago
The inline styles are experimental at the moment, because there are bugs in the AngleSharp library. But it would be great to have a small reproducible (or test as a PR), so I can fix the bug, if there is something on our side.
May I ask for some clarification? I noticed you flagged this feature as experimental in the README, but I’m unsure what exactly this refers to. Does this apply only to the usage of <mj-styles inline="inline">
and <mj-attributes>
, as linked in the documentation, or does it include regular inline attributes as well?
For instance:
<mj-button background-color="#F45E43" href="#">Learn more</mj-button>
This example uses inline attributes too. Are these considered experimental? This inline approach seems to be the standard one promoted throughout the documentation, and it has worked fine for me so far.
I'm asking because this is a significant factor for us in deciding whether to adopt the library.
Thanks!
We only talk about inline "mj-style" attributes as described here: https://documentation.mjml.io/#mj-style
This feature converts css declarations to inline styles and is not stable yet. Everything else is well covered, we run comparison tests over all sample email templates: https://github.com/SebastianStehle/mjml-net/tree/main/Tests/Templates
That's great, thanks for the clarification!
When I run my mjml template in the mjml.io try-it-live my inline styles are applied as I was expecting.
https://mjml.io/try-it-live/QMEUiLOGHD
But when running through mjml.net using the anglesharp PostProcessors I see inline styles added to every tag and not the inlines styles I've specified.
In the try it live mso-hide is added, in mjml.net it is not. In try it live, only styles in the inline are applied, in mjmj.net a bunch of styles are added in. Not sure where they are coming from.
Attached template, and mjml.net output. mjmj_template.txt renderedhtml.txt
Thanks.