sort: place svg, object-fit and table-layout in canonical order#122
Merged
Conversation
samoht
force-pushed
the
fix-family-sort-order
branch
from
July 13, 2026 04:35
826a6c2 to
4dddd24
Compare
svg (fill/stroke, canonical rank 70) sat at priority 30 - after padding, typography and effects - and object-fit was buried in layout's display priority. Both belong just after backgrounds and before padding, so this shifts the priority-21..30 band up by two to open the slot and drops svg into it, with object-fit returning its own priority per-variant.
table-auto, border-collapse and border-spacing (canonical rank 41) emit right after flex_props' shrink/grow/basis and before transforms; they were at the display priority (4), far too early.
…anonical slots size-* sorts first among sizing; resize (rank 47) and appearance (rank 49) split out of interactivity to just after cursor; list-style (rank 48) and text-overflow/truncate (rank 62) split out of late-typography to their early slots; vertical-align moves to just after text-align. All via per-variant priority with suborders that thread between the neighbouring families.
outline-* (rank ~92) split out of borders' border-width handler to after box-shadow/ring; and the late-typography families reordered to Tailwind's sequence tracking < word-break < whitespace < text-transform < italic < text-decoration < font-smoothing (italic moved from the early handler, decoration/word-break/antialiased resuborded).
text-clip/text-ellipsis (plain text-overflow, unlike the truncate shorthand) sort late with the text utilities, right after word-break.
tracking sorts alphabetically (normal before tight); border sides are side-major so each side's bare/numeric/arbitrary widths group together (border-t, border-t-2, border-t-[1px], border-r, ...) as Tailwind emits them.
text-color (the color property, canonical rank ~86) sorts after text-transform and before font-style/italic, not with the other color families. color.ml's Text_* variants return priority 26 with a fixed suborder in that gap, leaving accent/caret/etc at 25.
extract_base_utility left the leading ! on important classes (!flex, !max-h-screen), so they failed to parse and fell to the default last-place order; stripping it lets them sort with their base family as Tailwind emits them.
border-color (rank ~65) sorts alongside border-width/style at priority 19, not with the other color families at 25.
font-family sorts alphabetically (mono, sans, serif); outline-style (outline-none etc.) sorts after outline-width, matching Tailwind.
max-width sorts in Tailwind's three bands (container scale sizes 2xl..7xl, then numeric spacing, then letter keywords). Border colors: color.ml's arbitrary all-sides colors share suborder 1500 with borders.ml's named colors so they tie and sort by class name, and per-side colors sort after all-sides. This closes the ocaml.org canonical corpus diff to zero.
samoht
force-pushed
the
fix-family-sort-mid
branch
from
July 13, 2026 04:36
70e5fa7 to
ec84fe1
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Stacked on #121. Completes the family-order re-calibration so the ocaml.org corpus is render-identical to Tailwind v4:
tw <corpus> --diffnow printsNo differences found(from 52 reorders + 5 container block-placement markers at the start).Every displaced family moved to its canonical slot, via per-variant
priority : t -> intwhere a module spans several families:!importantclasses order by their base family instead of falling to last placePlus the within-family value orders: tracking and font-family alphabetical; border sides side-major; outline-style after outline-width; max-width in Tailwind's three bands (container scale, numeric, keywords); and named/arbitrary border colors sharing a suborder so they interleave by class name.