-
Notifications
You must be signed in to change notification settings - Fork 962
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
Unable to add class to the <body> tag #2396
Comments
I think there's an open issue about this somewhere. We really need to move the body tag in mj-body in next breaking version so css-class can be applied on the top level. cc @kmcb777 Do we have some other breaking change that we can push for a v5 ? |
Running into this same issue — need to add a class directly to the Are there any temporary workarounds? |
@matthewgovaere Are you using a build tool like Gulp with MJML? If yes, you could watch the output file and replace |
Thanks @mzrnsh — that's exactly what I ended up doing. Not ideal, but it'll work for now! |
Doesn’t work for the |
I am trying to implement a solution for an issue related to how Gmail iOS app's dark mode works.
For this solution to work, I need the
<body>
tag of the generated markup to have a class.body
.There could be another way to target the body tag within Gmail, but working on this made me realize that it's not currently possible to add a class to the
<body>
tag via MJML.I might have missed something, so apologies if that's the case. Here's what I've tried:
css-class
attribute onmj-body
:This applies the class to the
div
nested withinbody
, not tobody
directly.mj-html-attributes
:This doesn't do anything, so it makes me think the
body
selector doesn't work. Other CSS selectors did work so I don't think I am using themj-html-attributes
wrong.The text was updated successfully, but these errors were encountered: