Skip to content

style: use canonical tailwind class names - #1659

Merged
joshunrau merged 1 commit into
DouglasNeuroInformatics:mainfrom
joshunrau:tailwind-classes
Oct 6, 2026
Merged

joshunrau merged 1 commit into
DouglasNeuroInformatics:mainfrom
joshunrau:tailwind-classes

Conversation

@joshunrau

Copy link
Copy Markdown
Collaborator

What

Rewrites every class Tailwind CSS IntelliSense flags under suggestCanonicalClasses to its canonical spelling: 53 classes across 32 files in apps/web (29), apps/playground (16) and apps/outreach (8). No other workspace had findings.

Typical rewrites:

Before After
h-[1px] / w-[1px] h-px / w-px
w-[180px], max-w-[70rem], sm:max-w-[600px] w-45, max-w-280, sm:max-w-150
bg-gradient-to-br bg-linear-to-br
data-[disabled]:opacity-50 data-disabled:opacity-50
[&_[cmdk-group-heading]]:px-2 **:[[cmdk-group-heading]]:px-2
max-w-screen-md max-w-3xl
break-words wrap-break-word

Each canonical form compiles to the same CSS, so nothing renders differently. Some arbitrary pixel values become fractional spacing steps (w-22.5, sm:max-w-112.5, sm:max-w-118.75), which is what the lint asks for. In Header.astro the translate-x-112 class toggled by classList in the <script> was renamed with the markup, so the two still match.

Verification

  • Findings came from tailwindcss 4.3.3's designSystem.canonicalizeCandidates (the API the IntelliSense lint calls, root font size 16px), run per class over every tracked file in each workspace against its own CSS entrypoint. It reports 0 after the change.
  • pnpm lint, pnpm test:coverage (100% on every metric) and pnpm test:e2e (277 passed) are green.
  • No unit test, story or e2e spec used any of the old class strings as a selector or assertion.

Exception: no unit or e2e test was added. The change only renames classes to equivalent spellings with identical CSS output, so there is no behaviour for a test to cover.

Co-Authored-By: Claude Opus 5.5

Rewrite every class that Tailwind CSS IntelliSense flags under
suggestCanonicalClasses to the spelling tailwindcss 4.3.3's
canonicalizeCandidates returns (root font size 16px), e.g. h-[1px] -> h-px,
w-[180px] -> w-45, bg-gradient-to-br -> bg-linear-to-br,
data-[disabled]: -> data-disabled:. Each canonical form compiles to the same
CSS, so rendering is unchanged.

Covers apps/web, apps/playground and apps/outreach; no other workspace had
findings.

Co-Authored-By: Claude Opus 5.5
@joshunrau
joshunrau merged commit c7a6364 into DouglasNeuroInformatics:main Oct 6, 2026
2 checks passed
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