fix: correction of dark mode contrast in various locations#570
Open
nielsdrost7 wants to merge 5 commits into
Open
fix: correction of dark mode contrast in various locations#570nielsdrost7 wants to merge 5 commits into
nielsdrost7 wants to merge 5 commits into
Conversation
…emes Filament applies --gray-100 to .fi-sidebar-item.fi-active > .fi-sidebar-item-btn (the child <a> element), not the <li> container. All custom themes were only overriding the container, leaving the near-white button visible over dark/colored sidebars and making white text unreadable. Extend each theme's fi-active block to also target > .fi-sidebar-item-btn, > .fi-icon, and > .fi-sidebar-item-label. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017kszQmhdqv9E3RGvT8Q1Vv
yarn build → vite build --mode development → no minification, readable output yarn prod → vite build --mode production → minified output yarn dev → vite dev server (unchanged) vite.config.js now uses the function form of defineConfig to gate build.minify on whether mode === 'production'. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017kszQmhdqv9E3RGvT8Q1Vv
…ebars Three additional classes of the same root problem (Filament targeting child elements that the custom theme overrides don't reach): Nav item hover/focus: .fi-sidebar-item-has-url > .fi-sidebar-item-btn:hover applies --gray-100 — near-white flash on every link hover in a dark/colored sidebar. Fix: override with a mid-shade hover color per theme. Group trigger hover/focus: .fi-sidebar-group-dropdown-trigger-btn:hover applies --gray-100 — same white flash on expand/collapse buttons. Notifications button: hover gets --gray-100; icon gets --gray-400; label gets --gray-700 — all wrong on a dark/colored sidebar. User menu trigger: .fi-sidebar .fi-user-menu-trigger .fi-icon has specificity 0,3,0 so Filament's --gray-400 beats the theme's .fi-sidebar .fi-icon (0,2,0). .fi-tenant-menu-trigger-text gets --gray-950 (near-black on dark sidebar). Fix: nest overrides inside .fi-sidebar to match the same 0,3,0 specificity, letting cascade order (theme CSS comes after vendor CSS) resolve it. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017kszQmhdqv9E3RGvT8Q1Vv
Collaborator
Author
|
@coderabbitai summary |
Instead of only chasing individual --gray-* clashes with per-selector !important overrides, remap the entire --gray-* token scale per theme so every Filament component using var(--gray-*) gets the correct color automatically — including future components not yet patched. Two scopes per theme: :root — content-area neutral palette with the theme's hue family: Nord → Snow Storm (50) through Polar Night (950) Orange → warm off-white through dark warm brown Reddit → warm red-tinged off-white through dark red-brown Blue → cool blue-tinted off-white through deep navy IP → (skipped; primary is panel-defined, not file-defined) .fi-sidebar — inverted/sidebar-context scale so Filament's var(--gray-*) usages (hover bg, icon color, text color) all resolve correctly without needing a :where(.dark) class on the body: 50/100 → hover bg (theme mid-shade) 200 → active bg (theme dark shade) 300 → subtle border/divider 400–950 → white (fg on dark/colored sidebar) Nord uses var(--color-polarnight-*) / var(--color-snowstorm-*) references from its @theme block. InvoicePlane uses var(--color-primary-*). Blue uses var(--color-blue-*). Orange/Reddit use hex literals. Existing selector overrides are untouched and continue to work as explicit belt-and-suspenders for already-known cases. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017kszQmhdqv9E3RGvT8Q1Vv
The .fi-sidebar gray-token blocks were semantically incoherent: --gray-50 was set to a darker value than --gray-300, and the --gray-700/950 (body/strong text) mapped to white — inverting the 50=lightest → 950=darkest ordering that Filament and any future component relies on. The sidebar is also not a reliable scope for var() inheritance: portaled elements (dropdowns, modals) render on <body> and inherit from :root, not from .fi-sidebar. The :root content-area remaps and per-selector !important overrides remain. The selector overrides are the correct tool for the sidebar: explicit, scoped to exactly what they target, and don't depend on a semantically consistent neutral scale. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017kszQmhdqv9E3RGvT8Q1Vv
Contributor
📝 WalkthroughWalkthroughThe company Filament themes remap gray tokens and tighten sidebar active, hover, and trigger styling across the blue, nord, orange, and reddit variants. The Vite setup also splits development and production build commands and enables minification only in production. ChangesSidebar theme overrides
Build mode split
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
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.
Filament applies --gray-100 to .fi-sidebar-item.fi-active > .fi-sidebar-item-btn
(the child element), not the
overriding the container, leaving the near-white button visible over dark/colored
sidebars and making white text unreadable. Extend each theme's fi-active block to
also target > .fi-sidebar-item-btn, > .fi-icon, and > .fi-sidebar-item-label.
Addresses [BUG]: Active sidebar navigation item is unreadable due to light background #568
Summary by CodeRabbit
New Features
Bug Fixes
Chores