Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rename --width-* namespace to --container-* #14898

Merged
merged 3 commits into from
Nov 7, 2024

Conversation

adamwathan
Copy link
Member

This PR renames all of the --width-* variables to --container-* to better communicate the purpose of these tokens as layout container sizes. These are the values that were historically stored under maxWidth in the v3 and earlier eras, and were also re-used by the container queries plugin.

The name --container-* feels like a better match alongside the --breakpoint-* namespace and since these both serve that same sort of purpose it makes sense to me that the name should be optimized for feeling "right" in that context.

I like that this also sort of advertises Tailwind's support for container queries directly in the CSS variables themselves, and helps people understand what these are really intended to be used for.

@adamwathan adamwathan marked this pull request as ready for review November 6, 2024 21:59
@adamwathan adamwathan requested a review from a team as a code owner November 6, 2024 21:59
@adamwathan adamwathan merged commit 26638af into next Nov 7, 2024
1 check passed
@adamwathan adamwathan deleted the change/rename-width-namespace-to-container branch November 7, 2024 01:50
@@ -135,6 +135,7 @@ export function keyPathToCssProperty(path: string[]) {
if (path[0] === 'animation') path[0] = 'animate'
if (path[0] === 'transitionTimingFunction') path[0] = 'ease'
if (path[0] === 'fontFamily') path[0] = 'font'
if (path[0] === 'maxWidth') path[0] = 'container'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be just width? --max-width is still a namespace that is valid when used with the max-width helper but I think the intention is that the width namespace migrates to container by default?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh I see in v3 the max-w-* w-* and min-* utilities don't share a dimension :D never mind me

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.

3 participants