Skip to content

Conversation

@adamwathan
Copy link
Member

Fixes #15146.

This PR updates the w-*, max-w-*, min-w-*, and basis-* utilities to make sure that --spacing-* values are preferred over --container-* values when there is a conflict.

Given this theme configuration:

@theme {
 --spacing-sm: 8px;
 --container-sm: 256px;
}

…utilities like max-w-sm will use 8px instead of 256px after this change.

Users can still be explicit about the value they want to use if they've introduced a naming collision like this by using our variable shorthand like max-w-(--container-sm).

@adamwathan adamwathan requested a review from a team as a code owner November 25, 2024 21:32
@adamwathan adamwathan merged commit a022905 into next Nov 26, 2024
1 check passed
@adamwathan adamwathan deleted the fix/prefer-spacing-to-container branch November 26, 2024 14:45
@wongjn wongjn mentioned this pull request Dec 9, 2024
@marcospgp
Copy link

so it seems like you raised the issue and addressed it yourself, however your interpretation of spacing as a unit for sizing (width/height) seems contrary to the general interpretation (see #15348 (comment), #17777)

any chance this could be rolled back given evidence that it is an unpopular, unintuitive change?

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.

[v4] Problem with custom spacing - v4 is referencing var(--container-*) instead of var(--spacing-*)

4 participants