Skip to content

Conversation

@NssGourav
Copy link

@NssGourav NssGourav commented Feb 9, 2026

Summary

In Tailwind CSS v4, the migration logic for v3 configurations incorrectly maps the maxWidth theme key to the
--container-* CSS variable namespace. This causes clashes with container query variables and breaks the primary max-w-* utility design.

This PR updates OLD_TO_NEW_NAMESPACE to correctly map maxWidth to max-width.

Fixes #19555

Test Plan

Verified by updating existing core compatibility tests.

Execution command:

pnpm vitest packages/tailwindcss/src/compat/apply-config-to-theme.test.ts --run

@NssGourav NssGourav requested a review from a team as a code owner February 9, 2026 11:53
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 9, 2026

Walkthrough

This pull request updates the CSS property namespace mapping in the apply-config-to-theme module. The OLD_TO_NEW_NAMESPACE mapping is modified so that the maxWidth theme key now resolves to the max-width CSS property namespace instead of the container namespace. A corresponding test expectation is updated to reflect this mapping change, ensuring the test validates the new behavior.

🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: fixing the maxWidth namespace mapping from container to max-width in the v4 migration compatibility layer.
Description check ✅ Passed The description clearly explains the issue (maxWidth incorrectly mapped to --container namespace), the fix (mapping to max-width), and provides test verification details.
Linked Issues check ✅ Passed The PR directly addresses #19555 by fixing the OLD_TO_NEW_NAMESPACE mapping to correctly map maxWidth to max-width, preventing conflicts with container query variables and preserving utility semantics.
Out of Scope Changes check ✅ Passed All changes are scoped to the maxWidth namespace mapping fix in the compatibility layer; no extraneous modifications outside the stated objective are present.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


No actionable comments were generated in the recent review. 🎉


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Upgrade tool (3 -> 4) migrates maxWidth configuration to container vars

1 participant