Skip to content

Fix sorting of classes that have undefined declarations #16995

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

Merged
merged 1 commit into from
Mar 6, 2025

Conversation

philipp-spiess
Copy link
Member

Closes #16973

Declaration values of undefined are an implementation detail and skipped when printing the CSS. Thus, these should not count towards the sort order at a..

Test plan

  • See added regression test

@philipp-spiess philipp-spiess requested a review from a team as a code owner March 6, 2025 14:08
@philipp-spiess philipp-spiess force-pushed the chore/fix-sorting-of-undefined-decls branch from d83e2ab to a185861 Compare March 6, 2025 14:09
Comment on lines +15069 to +15073
.text-sm {
font-size: var(--text-sm);
line-height: var(--tw-leading, var(--text-sm--line-height));
}

Copy link
Member Author

Choose a reason for hiding this comment

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

This now uses alphabetical sorting becuase it has the same number of props as the arbitrary text classes

Comment on lines 16751 to +16755
font-size: var(--text-sm, .8755rem);
line-height: var(--text-sm--line-height, 1.255rem);
text-rendering: optimizeLegibility;
font-size: var(--text-sm, .875rem);
line-height: var(--tw-leading, var(--text-sm--line-height, 1.25rem));
Copy link
Member Author

Choose a reason for hiding this comment

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

This diff is weird but that's because of lightning flatting. What happens ehre is the custom new text-sm utility is now rendered before the core text-sm. The new prop text-rendering: optimizeLegibility; is still added, the rest is intended behavior here since you can't overwrite core utilities.

@philipp-spiess philipp-spiess merged commit 3d0606b into main Mar 6, 2025
5 checks passed
@philipp-spiess philipp-spiess deleted the chore/fix-sorting-of-undefined-decls branch March 6, 2025 14:20
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.

Custom utilities sorted incorrectly
2 participants