fix(decnet_web/css): light-mode contrast across wizards, code blocks, hovers
Sweeps four invariant violations that were leaking dark surfaces
into light mode and producing the unreadable / inverted areas:
1. Hardcoded `color: #000` in 14 :hover rules across 11 CSS
files swapped to `color: var(--bg)` — collapses to #000 in
dark mode (no-op), becomes cream in light. Fixes DEPLOY
DECKIES (button hover was rendering charcoal-purple text on
charcoal-purple background).
2. Hardcoded `background: #000` (3 sites) and `#0d1117`
(3 sites) replaced with `var(--bg)` / `var(--panel)`. Fixes
code blocks and modal panels staying dark on cream — the
deploy-wizard preview, topology-creation NAME input, and the
MazeNET canvas backdrop now follow the active theme.
3. `rgba(0,0,0,0.35)` and `rgba(0,0,0,0.5)` input/card
backgrounds (ServiceConfigForm, DeckyFleet .input)
swapped to `var(--panel)`. Fixes per-service config rows
in the deploy wizard rendering as dark slabs.
4. SVG arrow markers in MazeNET Canvas.tsx hardcoded
`fill="#00ff41"` / "#ee82ee" — replaced with currentColor +
style hook so they re-resolve on theme change.
New behaviour: light-mode hovers tint instead of inverting. The
dark-mode rules fully fill bg with --matrix/--violet/--alert and
flip text to --bg; that lands cream-on-near-ink in light mode
and reads as a jarring colour inversion every cursor move. Light
mode now layers a *-tint-10 background and keeps text in its
base colour. Single override block in index.css targets every
scoped `.X-btn`/`.btn`/`button:hover` via :is() + [class*="-btn"]
so we don't have to chase every component file.
This commit is contained in:
@@ -172,6 +172,44 @@ html[data-theme="light"] {
|
||||
--accent-glow: none;
|
||||
}
|
||||
|
||||
/* Hover behaviour in light mode.
|
||||
*
|
||||
* Dark mode hovers fully invert: bg fills with --matrix/--violet/
|
||||
* --alert and text becomes --bg. That works on black-cream because
|
||||
* neon-on-ink has obvious contrast. In light mode that same flip
|
||||
* lands cream text on near-ink and reads as a jarring colour
|
||||
* inversion every time the cursor moves.
|
||||
*
|
||||
* Light mode therefore tints instead of inverting — hover backgrounds
|
||||
* use the matching --*-tint-10, text stays in its base colour.
|
||||
* Targets every common scoped button class via [class*="-btn"] plus
|
||||
* the unprefixed .btn/button selectors. */
|
||||
html[data-theme="light"]
|
||||
:is(button, .btn, [class*="-btn"]):hover:not(:disabled) {
|
||||
background: var(--matrix-tint-10);
|
||||
color: var(--matrix);
|
||||
box-shadow: none;
|
||||
}
|
||||
html[data-theme="light"]
|
||||
:is(button, .btn, [class*="-btn"]).violet:hover:not(:disabled),
|
||||
html[data-theme="light"]
|
||||
:is(button, .btn, [class*="-btn"]).primary:hover:not(:disabled) {
|
||||
background: var(--violet-tint-10);
|
||||
color: var(--violet);
|
||||
}
|
||||
html[data-theme="light"]
|
||||
:is(button, .btn, [class*="-btn"]).alert:hover:not(:disabled),
|
||||
html[data-theme="light"]
|
||||
:is(button, .btn, [class*="-btn"]).danger:hover:not(:disabled) {
|
||||
background: var(--alert-tint-10);
|
||||
color: var(--alert);
|
||||
}
|
||||
html[data-theme="light"]
|
||||
:is(button, .btn, [class*="-btn"]).warn:hover:not(:disabled) {
|
||||
background: var(--warn-tint-10);
|
||||
color: var(--warn);
|
||||
}
|
||||
|
||||
*, *::before, *::after {
|
||||
box-sizing: border-box;
|
||||
margin: 0;
|
||||
@@ -220,9 +258,9 @@ button:disabled {
|
||||
|
||||
/* Shared .btn variants (unscoped) */
|
||||
.btn.violet { border-color: var(--violet); color: var(--violet); }
|
||||
.btn.violet:hover { background: var(--violet); color: #000; box-shadow: var(--violet-glow); }
|
||||
.btn.violet:hover { background: var(--violet); color: var(--bg); box-shadow: var(--violet-glow); }
|
||||
.btn.alert { border-color: var(--alert); color: var(--alert); }
|
||||
.btn.alert:hover { background: var(--alert); color: #000; box-shadow: 0 0 10px rgba(255, 65, 65, 0.5); }
|
||||
.btn.alert:hover { background: var(--alert); color: var(--bg); box-shadow: 0 0 10px rgba(255, 65, 65, 0.5); }
|
||||
.btn.ghost { border-color: var(--border); color: var(--matrix); opacity: 0.7; }
|
||||
.btn.ghost:hover {
|
||||
background: transparent; color: var(--matrix); opacity: 1;
|
||||
|
||||
Reference in New Issue
Block a user