refactor(ui): map hardcoded Tailwind palette classes onto semantic tokens - #37576
Merged
yuneng-berri merged 2 commits intoAug 20, 2026
Merged
Conversation
…kens The dashboard painted itself with literal palette utilities (text-gray-500, bg-blue-50, border-red-200) that resolve to one fixed color regardless of theme, so the shadcn token layer and its .dark block could never take effect. A codemod (scripts/codemod-color-tokens.mjs) rewrites 3,232 of those across 254 files onto the existing token scale: neutrals become foreground / muted-foreground / muted / border / card, and red, green, amber and blue collapse into destructive, success, warning and info, with the pale -50 to -300 tints expressed as opacity modifiers on the same token. Hover and focus variants map to accent so they lift rather than recess. 210 now-redundant dark: variants are dropped since the tokens carry both modes. The .dark palette is retuned to a neutral gray ramp with the sidebar recessed below the content canvas, replacing the blue-tinted shadcn default where the sidebar read as a full-height card floating on a near-black page. Nothing sets the .dark class yet, so light mode is unchanged and dark mode stays inert until a theme toggle lands.
Contributor
|
Too many files changed for review (257 files, 100 file limit). Bypass the limit by tagging |
yuneng-berri
approved these changes
Aug 20, 2026
yuneng-berri
merged commit Aug 20, 2026
57b328f
into
litellm_internal_staging
66 of 67 checks passed
yuneng-berri
added a commit
that referenced
this pull request
Aug 20, 2026
…ken migration (#37579) * fix(ui): restore hover feedback and dark-mode variants lost in the token migration PR #37576 mapped hardcoded Tailwind palette classes onto semantic tokens. Two-tone hover pairs collapsed onto a single token, so 116 hover utilities across 49 files became identical to their base class and produced no visible feedback, and in seven files a dark: variant was dropped while its hardcoded light partner survived, leaving those elements stuck light in dark mode. Hover states now follow the alpha-step idiom the shadcn primitives already use (hover:bg-primary/80, hover:bg-success/20): a duplicated hover:text-X or hover:bg-X becomes /80, hover:border-border becomes hover:border-ring, and a duplicate is dropped where another hover utility on the element already carries the change. One transition-colors that no longer animated anything is removed. For the dark-mode gaps, indigo maps onto info and amber onto warning. There is no purple token in globals.css, so the purple sites keep their palette classes and get their dark: partner back. * fix(ui): add an eslint rule that fails a hover: utility identical to its base The token migration collapsed two-tone hover pairs by hand, so nothing catches the next one. `local/no-noop-hover-variant` reads every string literal and template chunk and errors when a `hover:X` sits alongside a bare `X`, which is exactly the shape that renders no hover feedback. It ships at error with no suppression baseline, so the eleven sites that already carried a dead hover before the migration are fixed here too. The rule reads one class string at a time, so a base class supplied by a different ternary branch than its hover partner is left alone: a selected row whose resting colour already matches its hover colour is deliberate, not a bug.
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.
TLDR
Problem this solves:
.darkblock exists but can never take effectHow it solves it:
User Flow
Before: a proxy admin who prefers dark interfaces has no way to get one, and would see a broken page even if they forced it
After: the same forced-dark page renders as a coherent dark interface, so a theme control can be added on top of it
Relevant issues
Linear ticket
Pre-Submission checklist
Screenshots / Proof of Fix
Before (7b574b9)
Light mode, unchanged baseline
Dark mode forced from devtools
<html>element and addclass="dark"After (922f065)
Light mode, unchanged baseline
Dark mode forced from devtools
<html>element and addclass="dark"#212121, sidebar#131313, row dividers#303030, all text and badges legibleType
🧹 Refactoring
Caveats (if any)
@tailwindcss/formsstill paints bare inputs whiteFinal Attestation