Skip to content

Tailwind: canonical class names, with a CI guard - #21

Merged
fadeltd merged 3 commits into
mainfrom
chore/tailwind-canonical
Oct 29, 2026
Merged

fadeltd merged 3 commits into
mainfrom
chore/tailwind-canonical

Conversation

@fadeltd

@fadeltd fadeltd commented Oct 29, 2026 •

Copy link
Copy Markdown
Owner

Changed

  • 55 Tailwind classes rewritten to their canonical form, with no visual change
  • pnpm tw:fix reports non-canonical classes; --write fixes them
  • A test fails CI when a non-canonical class appears

Rewrites the 55 classes the Tailwind editor extension flagged as having a canonical spelling (w-[220px] → w-55, rounded-[2px] → rounded-xs, bg-[length:…] → bg-size-[…], [scrollbar-width:none] → scrollbar-none, [&>*]: → *:, and so on). Computed styles are identical before and after on 14 routes at 1280px and 400px.

scripts/tailwind.ts runs Tailwind's own canonicalizer (the engine behind the editor hints) over every string and template literal in src/**/*.tsx, parsed with oxc so JSX text is never touched. `pnpm tw:fix` reports them and `--write` rewrites them; scripts/tailwind.test.ts fails CI when one appears, so new code, including agent-written tools, stays canonical.

Adds @tailwindcss/node 4.3.3 as a dev dependency for its design-system loader.
Map.groupBy is ES2024 and the repo targets the ES2023 lib, so the script failed typecheck.
The test generated two ULIDs with the same seed but the real clock, so a millisecond tick between the calls changed the time prefix and lower !== upper.toLowerCase(). Both calls now use the fixed clock the rest of the file uses.
@fadeltd fadeltd self-assigned this Oct 29, 2026
@fadeltd
fadeltd merged commit e1ec0bb into main Oct 29, 2026
1 check passed
@fadeltd
fadeltd deleted the chore/tailwind-canonical branch October 29, 2026 17:44
@fadeltd fadeltd changed the title Tailwind: canonical class spellings, with a guard test Tailwind: canonical class names, with a CI guard Oct 30, 2026
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.

1 participant