fix: dark-mode CSS leaks — listbox hover, base buttons, light badges, grid stripes#5
Merged
Merged
Conversation
The listbox-item hover rule lost a specificity contest to Radzen's material-base, whose selector doubles the pseudo-class and adds a :not() (`.rz-listbox:not(.rz-state-disabled) .rz-listbox-item:hover:hover`). Our plain `.rz-listbox-item:hover` is less specific, so in dark mode the light base-theme hover colour won — dark text on a near-white row, effectively invisible. Visible anywhere a RadzenListBox is used (e.g. the user/role assignment dialogs). Match Radzen's selector exactly; since this layer loads after material-base, equal specificity resolves in our favour on source order.
…ark mode design.css remaps most Radzen tokens but missed a few, so the components using them kept Radzen's light-theme defaults on the dark shell: - --rz-base / --rz-on-base back ButtonStyle.Base — used by DialogService.Confirm's Cancel button — so every confirm dialog showed one white button. - --rz-base-200 backs BadgeStyle.Light; unmapped it paired a light background with the remapped near-white text (~1.2:1 contrast, unreadable). - --rz-grid-stripe-* left every second data-grid row white. Map them through the same --ag-* tokens as the rest of the block, so light mode stays correct automatically. Closes #4.
This was referenced Jul 17, 2026
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.
Two dark-mode fixes in
design.css, bundled for one release. Both are the same class of bug: a Radzen style wins over (or is missed by) the design layer, so a light-theme colour leaks onto the dark shell.1. Listbox item hover unreadable (specificity)
Hovering a
RadzenListBoxitem gave a near-white row with dark, invisible text.design.cssstyled the hover, but Radzen'smaterial-baseuses a deliberate specificity bump —.rz-listbox:not(.rz-state-disabled) .rz-listbox-item:hover:hover(0,5,0) — that beats our.rz-listbox .rz-listbox-item:hover(0,3,0), so the light base-theme colour won.Fix: match Radzen's selector exactly. Equal specificity → source order decides, and
design.cssloads aftermaterial-base, so our rule wins. Visible on the user/role assignment dialogs.2. Unmapped tokens leak the light theme (closes #4)
design.cssremaps most Radzen tokens but missed a few, leaving Radzen's light defaults:--rz-base/--rz-on-basebackButtonStyle.Base— used byDialogService.Confirm's Cancel button — so every confirm dialog showed one white button.--rz-base-200backsBadgeStyle.Light; unmapped it paired a light background with the remapped near-white text (~1.2:1 contrast, unreadable).--rz-grid-stripe-*left every secondRadzenDataGridrow white.Fix: map them through the same
--ag-*tokens as the rest of the block. Because--ag-*switch per theme, light mode stays correct automatically. Mappings and contrast (11.5:1 dark / 9.5:1 light, both AAA) are from the measurements in #4.Verification
Both are deterministic CSS fixes (cascade order for #1, token remap for #2), verified by analysis against the real
material-base.css(Radzen.Blazor 10.3.2) selector/token chain rather than a screenshot. #2's contrast figures come from the reporter's in-browser measurements against the same stylesheet chain.Fixes #4.