Ensure individual logical property utilities are sorted later than left/right pair utilities #14777
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.
Resolves #14772.
This PR fixes an issue where utilities like
ps-2were sorted earlier in the generated CSS thanpx-3, causingps-2to not overridepx-3as expected.This happened because
px-3usespadding-leftandpadding-right, andps-2usespadding-inline-start, and inproperty-order.tswe sort those properties as follows:Since
padding-leftandpadding-rightboth appear later thanpadding-inline-start, thepx-3utility is sorted later in the CSS since all of its properties are later in the sort order than all of properties inps-2.To fix this, I'm using our internal
--tw-sortproperty to tell Tailwind to sort thepx-3utility as if it usedpadding-inlineto ensure that it's sorted earlier in the CSS.This PR applies this same fix for the
paddingutilities,scroll-marginutilities, andscroll-paddingutilities. No changes have been made to themarginutilities because we were already handling this correctly there.Here you can see that
pl-2overridespx-6as you'd expect:…and now with the change in this PR,
ps-2also overridespx-6as you'd expect: