# What changed in postcss-custom-media

> 13 changes in postcss-custom-media 7 to 12 from its official release notes, upgrade guides and advisories: 6 breaking, 3 new APIs and options. Each one cited. Sources checked 2026-11-13. HTML: https://unstale.sh/npm/postcss-custom-media/

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

## postcss-custom-media 12

### Breaking changes

- An error is thrown when a custom media expansion exceeds the maximum size or length. (12.0.2) — [release notes](https://github.com/csstools/postcss-plugins/blob/de8cbdf29ae4c6f2312033499341a17577bbf8a5/plugins/postcss-custom-media/CHANGELOG.md#1202)
- An error is thrown when @layer nesting exceeds a safe depth. (12.0.2) — [release notes](https://github.com/csstools/postcss-plugins/blob/de8cbdf29ae4c6f2312033499341a17577bbf8a5/plugins/postcss-custom-media/CHANGELOG.md#1202)
- The commonjs API was removed; supported Node versions can use require(esm) without code changes. (12.0.0) — [release notes](https://github.com/csstools/postcss-plugins/blob/de8cbdf29ae4c6f2312033499341a17577bbf8a5/plugins/postcss-custom-media/CHANGELOG.md#1200)
- Node.js 20.19.0 or later is now required. (12.0.0) — [release notes](https://github.com/csstools/postcss-plugins/blob/de8cbdf29ae4c6f2312033499341a17577bbf8a5/plugins/postcss-custom-media/CHANGELOG.md#1200)

### Performance

- Performance was improved. (12.0.2) — [release notes](https://github.com/csstools/postcss-plugins/blob/de8cbdf29ae4c6f2312033499341a17577bbf8a5/plugins/postcss-custom-media/CHANGELOG.md#1202)

### Fixes and other changes

- Handling of cyclic custom media references is deterministic. (12.0.2) — [release notes](https://github.com/csstools/postcss-plugins/blob/de8cbdf29ae4c6f2312033499341a17577bbf8a5/plugins/postcss-custom-media/CHANGELOG.md#1202)
- Cascade layer names no longer grow exponentially for deeply nested @layer rules. (12.0.2) — [release notes](https://github.com/csstools/postcss-plugins/blob/de8cbdf29ae4c6f2312033499341a17577bbf8a5/plugins/postcss-custom-media/CHANGELOG.md#1202)
- Fixes the importance of custom media in anonymous cascade layers. (12.0.1) — [release notes](https://github.com/csstools/postcss-plugins/blob/de8cbdf29ae4c6f2312033499341a17577bbf8a5/plugins/postcss-custom-media/CHANGELOG.md#1201)

## postcss-custom-media 7

### Breaking changes

- Adds support for Node v6 and later. (7.0.0) — [release notes](https://github.com/csstools/postcss-plugins/blob/HEAD/plugins/postcss-custom-media/CHANGELOG.md)
- Adds support for PostCSS v7. (7.0.0) — [release notes](https://github.com/csstools/postcss-plugins/blob/HEAD/plugins/postcss-custom-media/CHANGELOG.md)

### New APIs and options

- Adds a function to specify where to export custom media. (7.0.0) — [release notes](https://github.com/csstools/postcss-plugins/blob/HEAD/plugins/postcss-custom-media/CHANGELOG.md)
- Adds the importFrom option to specify where to import custom media. (7.0.0) — [release notes](https://github.com/csstools/postcss-plugins/blob/HEAD/plugins/postcss-custom-media/CHANGELOG.md)
- Adds the preserve option to preserve custom media and the at-rules that use them. (7.0.0) — [release notes](https://github.com/csstools/postcss-plugins/blob/HEAD/plugins/postcss-custom-media/CHANGELOG.md)
