When compiling, I get the issue: Line 50 (mj-text) — Attribute css-class is illegal
What's the correct way to add a class to an mj component?
Hey @aybmab,
css-class is mentioned in the documentation but is only available in v3.3.3-beta.1, sorry for that. To install and try it: npm install [email protected]
Hi @ngarnier,
I just tried to use the css-class attribute on mj-column (as mentioned in docs) with [email protected] and I still got the same error message : Line 91 (mj-column) — Attribute css-class is illegal
Any ideas or in-depth debugging tools ?
Hi @nicolas-goudry
Make sure you've installed the beta. If so you can ignore the message, we forgot to release a beta version of mjml-validator package that whitelist this attribute.
@iRyusa I checked in package.json of mjml folder under node_modules, it was the right version.
Anyway, the HTML generated does contain the css class and everything I set, so it’s ok !
Sorry and thanks for your quick help.
I'm closing this issue, as css-class does work in the beta. Thanks for reporting the validation issue @nicolas-goudry.
Loving MJML and thanks for the heads up on this!
Could you try to update the docs? I was banging my head against a wall for some time trying to figure out why this css-class wouldn't work.
@kpettinga Same here. Glad I also found this issue... after _several_ attempts to re-code it. Would like to see an update to docs or push to master. @ngarnier
Hi guys, v3.3.3 was just released, install with npm install mjml. It's not available in the try it live yet, but will be in the coming days/week. Sorry again for the trouble about the documentation.
cc @kpettinga @MissFerrety
Most helpful comment
Hi guys, v3.3.3 was just released, install with
npm install mjml. It's not available in the try it live yet, but will be in the coming days/week. Sorry again for the trouble about the documentation.cc @kpettinga @MissFerrety