# What changed in mjml

> 38 changes in mjml 4 to 5 from its official release notes, upgrade guides and advisories: 12 breaking, 1 security, 5 new APIs and options. Each one cited. Sources checked 2026-10-18. HTML: https://unstale.sh/npm/mjml/

To see which of these apply to a repository, run `npx @unstale/cli init` in it.

## mjml 5

### Breaking changes

- The CLI include options have stricter behavior; users must explicitly allow includes rather than relying on implicit include behavior. (5.0.0) — [release notes](https://github.com/mjmlio/mjml/releases/tag/v5.0.0)
- The body HTML tag is generated under mj-body rather than by the global skeleton, changing the outer HTML structure. (5.0.0) — [release notes](https://github.com/mjmlio/mjml/releases/tag/v5.0.0)
- HTML minification now uses htmlnano instead of html-minifier, producing more aggressively minified output; custom minifier options need to be remapped. (5.0.0) — [release notes](https://github.com/mjmlio/mjml/releases/tag/v5.0.0)
- Includes are ignored by default, so projects must explicitly allow them. (5.0.0) — [release notes](https://github.com/mjmlio/mjml/releases/tag/v5.0.0)
- The background-color attribute no longer applies to the body tag and instead applies only to the child div. (5.0.0) — [release notes](https://github.com/mjmlio/mjml/releases/tag/v5.0.0)
- The class attribute is applied to the body tag rather than the child div, which can affect external CSS targeting. (5.0.0) — [release notes](https://github.com/mjmlio/mjml/releases/tag/v5.0.0)
- inner-padding is now applied to all clients rather than only Outlook. (5.0.0) — [release notes](https://github.com/mjmlio/mjml/releases/tag/v5.0.0)
- 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.0) — [release notes](https://github.com/mjmlio/mjml/releases/tag/v5.0.0)
- The standalone migration tool is removed, so MJML 5 can no longer automatically migrate very old MJML syntax on the fly. (5.0.0) — [release notes](https://github.com/mjmlio/mjml/releases/tag/v5.0.0)
- Node 20, 22, and 24 are the supported CI versions; Node 16 and 18 are effectively deprecated or unsupported. (5.0.0) — [release notes](https://github.com/mjmlio/mjml/releases/tag/v5.0.0)
- The noMigrateWarn option is removed along with the migration helper. (5.0.0) — [release notes](https://github.com/mjmlio/mjml/releases/tag/v5.0.0)

### Security

- Resolved numerous production security vulnerabilities. (5.3.0) — [release notes](https://github.com/mjmlio/mjml/releases/tag/v5.3.0)

### New APIs and options

- Adds a gutter attribute to add space between columns. (5.4.0) — [release notes](https://github.com/mjmlio/mjml/releases/tag/v5.4.0)
- Adds a border attribute to mj-social-element. (5.4.0) — [release notes](https://github.com/mjmlio/mjml/releases/tag/v5.4.0)
- A new option explicitly controls where includes can be loaded from outside of a templates filePath. (5.0.0) — [release notes](https://github.com/mjmlio/mjml/releases/tag/v5.0.0)
- The id attribute is now available on mj-body. (5.0.0) — [release notes](https://github.com/mjmlio/mjml/releases/tag/v5.0.0)

### Performance

- Beautification now uses Biome instead of Prettier, addressing slow calls on large MJML documents that caused 504 errors. (5.1.0) — [release notes](https://github.com/mjmlio/mjml/releases/tag/v5.1.0)

### Behavior and default changes

- All border-radius attributes now accept a string, allowing more flexible input and making values less strict for some components. (5.0.0) — [release notes](https://github.com/mjmlio/mjml/releases/tag/v5.0.0)
- 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.0) — [release notes](https://github.com/mjmlio/mjml/releases/tag/v5.0.0)

### Tooling

- The CLI now emits warnings for denied mj-includes. (5.2.2) — [release notes](https://github.com/mjmlio/mjml/releases/tag/v5.2.2)
- MJML uses js-beautify for beautification in mjml-core and mjml-browser, aiming for more stable, predictable output and better performance. (5.2.0) — [release notes](https://github.com/mjmlio/mjml/releases/tag/v5.2.0)

### Fixes and other changes

- Fixes a crash in strict validation when an mj-include is denied. (5.4.1) — [release notes](https://github.com/mjmlio/mjml/releases/tag/v5.4.1)
- Fixed CLI watch behaviour. (5.3.0) — [release notes](https://github.com/mjmlio/mjml/releases/tag/v5.3.0)
- 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.2) — [release notes](https://github.com/mjmlio/mjml/releases/tag/v5.2.2)
- Fixes `mj-accordion` elements being closed by default in new versions of Outlook. (5.2.1) — [release notes](https://github.com/mjmlio/mjml/releases/tag/v5.2.1)
- Fixes handling of async watch compilation in mjml-cli. (5.2.0) — [release notes](https://github.com/mjmlio/mjml/releases/tag/v5.2.0)
- Template syntax is sanitized before PostCSS processing and restored afterward, affecting templates that place markers in CSS or style attributes. (5.0.0) — [release notes](https://github.com/mjmlio/mjml/releases/tag/v5.0.0)

## mjml 4

### Breaking changes

- mj-section no longer inherits attributes from context. (4.17.2) — [release notes](https://github.com/mjmlio/mjml/releases/tag/v4.17.2)

### New APIs and options

- Adds a gap between sections in mj-wrapper. (4.17.0) — [release notes](https://github.com/mjmlio/mjml/releases/tag/v4.17.0)

### Fixes and other changes

- Fixed allowed attributes not inheriting in mj-wrapper. (4.17.1) — [release notes](https://github.com/mjmlio/mjml/releases/tag/v4.17.1)
- The font-family attribute is now respected. (4.17.0) — [release notes](https://github.com/mjmlio/mjml/releases/tag/v4.17.0)
- The padding-x attribute is now respected. (4.17.0) — [release notes](https://github.com/mjmlio/mjml/releases/tag/v4.17.0)
- Thumbnails are hidden when not supported. (4.17.0) — [release notes](https://github.com/mjmlio/mjml/releases/tag/v4.17.0)
- Fixes border-radius, which was not working. (4.17.0) — [release notes](https://github.com/mjmlio/mjml/releases/tag/v4.17.0)
- Fixes ico-padding-x, which was not working. (4.17.0) — [release notes](https://github.com/mjmlio/mjml/releases/tag/v4.17.0)
- The align attribute is now respected. (4.17.0) — [release notes](https://github.com/mjmlio/mjml/releases/tag/v4.17.0)
- The icon-height attribute is now respected. (4.17.0) — [release notes](https://github.com/mjmlio/mjml/releases/tag/v4.17.0)
- The cellspacing attribute is now respected. (4.17.0) — [release notes](https://github.com/mjmlio/mjml/releases/tag/v4.17.0)
