Files
ebc1150c82 add support for cssmodules-pure-no-check to allow global CSS features like View Transitions (#77321)
## What?

This PR adds support for `cssmodules-pure-no-check` in CSS Modules by
upgrading `postcss-modules-local-by-default` from 4.0.4 to 4.2.0
(`cssmodules-pure-no-check` was also recently [merged into LightningCSS
1.29.3](https://github.com/parcel-bundler/lightningcss/pull/898))

## Why?
Global CSS selectors like View Transitions API require global scope to
work properly. Currently, there's no clean way to use these selectors
with CSS Modules in Next.js, which causes issues when:
1. Using the View Transitions API
2. Migrating from css-in-js libraries like styled-components to React
Server Components with CSS Modules

## How?
- Upgrades `postcss-modules-local-by-default` to 4.2.0
- Adds support for the `/* cssmodules-pure-no-check */` comment pattern
in CSS files which disables CSS Modules localization for that file
- This mirrors established escape hatches in other tools (`@ts-nocheck`,
`/* eslint-disable */`)
- Added tests (similar to one @samcx wrote previously) to ensure
functionality works correctly

The approach was previously approved by @samcx in issue #77232, who
mentioned that LightningCSS was already bumped, but we needed to bump
the PostCSS side

Fixes #77232

---------

Co-authored-by: Sam Ko <[email protected]>
2025-04-02 08:43:26 -07:00
..