unstale

npm / mjml

mjml

What changed in mjml 4 to 5, from its official release notes, upgrade guides and advisories. Sources checked 2026-10-18.

12 breaking1 security5 new APIs and options1 performance2 behavior and defaults2 tooling15 fixes and other

See which of these apply to your code, ranked, in your agent:

npx @unstale/cli init

@unstale/cli 0.1.1 on npm

mjml 527 changes

Breaking changes 11

  • The CLI include options have stricter behavior; users must explicitly allow includes rather than relying on implicit include behavior.

    5.0.0release notes

  • The body HTML tag is generated under mj-body rather than by the global skeleton, changing the outer HTML structure.

    5.0.0release notes

  • HTML minification now uses htmlnano instead of html-minifier, producing more aggressively minified output; custom minifier options need to be remapped.

    5.0.0release notes

  • Includes are ignored by default, so projects must explicitly allow them.

    5.0.0release notes

  • The background-color attribute no longer applies to the body tag and instead applies only to the child div.

    5.0.0release notes

  • The class attribute is applied to the body tag rather than the child div, which can affect external CSS targeting.

    5.0.0release notes

  • inner-padding is now applied to all clients rather than only Outlook.

    5.0.0release notes

  • Its build and minification pipeline now uses new minifiers; direct imports or reliance on legacy build scripts may see behavior and bundle shape changes.

    5.0.0release notes

  • The standalone migration tool is removed, so MJML 5 can no longer automatically migrate very old MJML syntax on the fly.

    5.0.0release notes

  • Node 20, 22, and 24 are the supported CI versions; Node 16 and 18 are effectively deprecated or unsupported.

    5.0.0release notes

  • The noMigrateWarn option is removed along with the migration helper.

    5.0.0release notes

Security 1

  • Resolved numerous production security vulnerabilities.

    5.3.0release notes

New APIs and options 4

  • Adds a gutter attribute to add space between columns.

    5.4.0release notes

  • Adds a border attribute to mj-social-element.

    5.4.0release notes

  • A new option explicitly controls where includes can be loaded from outside of a templates filePath.

    5.0.0release notes

  • The id attribute is now available on mj-body.

    5.0.0release notes

Performance 1

  • Beautification now uses Biome instead of Prettier, addressing slow calls on large MJML documents that caused 504 errors.

    5.1.0release notes

Behavior and default changes 2

  • All border-radius attributes now accept a string, allowing more flexible input and making values less strict for some components.

    5.0.0release notes

  • CSS minification uses cssnano presets wired via mjml-core, with the lite preset used by default; the default preset can be selected if your fonts don’t contain numerals.

    5.0.0release notes

Tooling 2

  • The CLI now emits warnings for denied mj-includes.

    5.2.2release notes

  • MJML uses js-beautify for beautification in mjml-core and mjml-browser, aiming for more stable, predictable output and better performance.

    5.2.0release notes

Fixes and other changes 6

  • Fixes a crash in strict validation when an mj-include is denied.

    5.4.1release notes

  • Fixed CLI watch behaviour.

    5.3.0release notes

  • CLI relative includePath entries are resolved against process.cwd() before being passed to mjml-core, so paths work when the template is in a subdirectory.

    5.2.2release notes

  • Fixes mj-accordion elements being closed by default in new versions of Outlook.

    5.2.1release notes

  • Fixes handling of async watch compilation in mjml-cli.

    5.2.0release notes

  • Template syntax is sanitized before PostCSS processing and restored afterward, affecting templates that place markers in CSS or style attributes.

    5.0.0release notes

mjml 411 changes

Breaking changes 1

  • mj-section no longer inherits attributes from context.

    4.17.2release notes

New APIs and options 1

Fixes and other changes 9