Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inline style are applied differently to https://mjml.io/try-it-live #207

Open
drgrieve opened this issue Oct 22, 2024 · 4 comments
Open

Comments

@drgrieve
Copy link

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.

@SebastianStehle
Copy link
Owner

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.

@RichardBechera
Copy link

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!

@SebastianStehle
Copy link
Owner

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

@RichardBechera
Copy link

That's great, thanks for the clarification!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants