Sort text wrapping utilities with typography utilities #14787
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR implements some changes to the way we sort typography utilities, inspired by #14715.
Prior to this PR, utilities like
text-balance
,break-words
, andtext-center
were sorted very early, even before things like border utilities:This PR changes the sort order to co-locate these with other typography utilities which feels a lot more natural:
I've also made some small adjustments to how other typography properties are sorted based on pairing with @reinink and just deciding what felt the most intuitive to us and matched the order we'd likely type things in manually.
To test this change I temporarily added a new test to
sort.test.ts
to make sure the classes were sorted in the expected order:Didn't keep the test around because there's no real logic to test here (it just matches the order in the
property-order.ts
file) and we don't have any other tests like this.I've also made some minor unrelated changes here like deleting legacy properties from
property-order.ts
that are never used, and fixing a typo where we wrotework-break
instead ofword-break
.