fix(frontend): var-derive hardcoded palette colours for theme-swap safety

Replace ~92 hardcoded Catppuccin rgba literals across the dashboard,
agent, and shared terminal stylesheets with color-mix() over the theme
:root vars, so a stylix-generated theme.css recolours the whole UI, not
just the elements that already referenced the vars. Pixel-identical
under the default palette (same RGB + alpha; color-mix(in srgb, C N%,
transparent) == rgba(C, N/100)).

Also fixes four var(--mauve, #cba6f7) usages: --mauve is undefined (the
var is --purple), so they were silently falling back to the hardcoded
hex and would not have recoloured on a theme swap. The bare crust hex in
terminal.css and the checkerboard-gradient hexes in common.css are
var-derived too.

Pure black/white drop-shadow/frost scrims are left as literals (not
theme colours). Two off-palette surface tints (dim-purple schedule rows,
warm-amber inline-button hover) are also left, with a comment, pending a
dedicated named var. Correct-var fallbacks like var(--red, #f38ba8) are
left as-is since they already recolour via the var.
This commit is contained in:
iris 2026-06-08 20:48:11 +02:00
commit 742d4a5c6d
6 changed files with 112 additions and 107 deletions

View file

@ -15,7 +15,7 @@
on top, state strip below). */
--agent-header-h: 6em;
--agent-composer-h: 3.6em;
--agent-frost-bg: rgba(30, 30, 46, 0.72);
--agent-frost-bg: color-mix(in srgb, var(--bg) 72%, transparent);
--agent-frost-blur: blur(12px) saturate(140%);
}
@ -47,7 +47,7 @@ body:not(.agent-shell):not(.screen-shell) {
-webkit-background-clip: text;
background-clip: text;
color: transparent;
filter: drop-shadow(0 0 6px rgba(203, 166, 247, 0.45));
filter: drop-shadow(0 0 6px color-mix(in srgb, var(--purple) 45%, transparent));
}
body.agent-shell {
@ -59,7 +59,7 @@ body.agent-shell {
surface some depth and reinforce the vibec0re mood. */
background:
radial-gradient(ellipse 80% 60% at 50% 0%,
rgba(203, 166, 247, 0.06) 0%,
color-mix(in srgb, var(--purple) 6%, transparent) 0%,
transparent 60%),
var(--bg);
}
@ -136,7 +136,7 @@ h2, h3 {
color: var(--purple);
text-transform: uppercase;
letter-spacing: 0.15em;
text-shadow: 0 0 8px rgba(203, 166, 247, 0.4);
text-shadow: 0 0 8px color-mix(in srgb, var(--purple) 40%, transparent);
}
.agent-icon {
/* Square identity anchor explicit 5em sizing + align-self.
@ -148,7 +148,7 @@ h2, h3 {
flex-shrink: 0;
align-self: flex-start;
border-radius: 8px;
box-shadow: 0 0 18px -2px rgba(203, 166, 247, 0.4);
box-shadow: 0 0 18px -2px color-mix(in srgb, var(--purple) 40%, transparent);
object-fit: cover;
}
@ -163,13 +163,13 @@ h2, h3 {
letter-spacing: 0.04em;
padding: 0.1em 0.35em;
border-radius: 3px;
text-shadow: 0 0 4px rgba(137, 220, 235, 0.4);
text-shadow: 0 0 4px color-mix(in srgb, var(--cyan) 40%, transparent);
transition: color 0.15s ease, text-shadow 0.15s ease, background 0.15s ease;
}
.agent-nav-link:hover {
color: var(--fg);
background: rgba(137, 220, 235, 0.08);
text-shadow: 0 0 10px rgba(137, 220, 235, 0.85);
background: color-mix(in srgb, var(--cyan) 8%, transparent);
text-shadow: 0 0 10px color-mix(in srgb, var(--cyan) 85%, transparent);
}
/* Overflow menu trigger `` round button on the right of the
@ -238,7 +238,7 @@ h2, h3 {
transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.overflow-item:hover {
background: rgba(203, 166, 247, 0.08);
background: color-mix(in srgb, var(--purple) 8%, transparent);
border-color: var(--purple-dim);
}
.overflow-item-icon {
@ -251,12 +251,12 @@ h2, h3 {
.overflow-item-new-session { color: var(--amber); }
.overflow-item-rebuild:hover,
.overflow-item-new-session:hover {
background: rgba(250, 179, 135, 0.1);
background: color-mix(in srgb, var(--amber) 10%, transparent);
border-color: var(--amber);
}
.overflow-item-dashboard { color: var(--cyan); }
.overflow-item-dashboard:hover {
background: rgba(137, 220, 235, 0.1);
background: color-mix(in srgb, var(--cyan) 10%, transparent);
border-color: var(--cyan);
}
.overflow-item:disabled {
@ -281,13 +281,13 @@ h2, h3 {
}
.overflow-item-model:hover {
color: var(--fg);
background: rgba(203, 166, 247, 0.08);
background: color-mix(in srgb, var(--purple) 8%, transparent);
border-color: var(--purple-dim);
}
.overflow-item-model.active {
color: var(--purple);
border-color: var(--purple-dim);
background: rgba(203, 166, 247, 0.06);
background: color-mix(in srgb, var(--purple) 6%, transparent);
}
/* Header pill — inbox / loose-ends triggers. Compact, count-prominent. */
@ -324,11 +324,11 @@ h2, h3 {
font-variant-numeric: tabular-nums;
}
.header-pill-inbox .header-pill-count {
background: rgba(250, 179, 135, 0.18);
background: color-mix(in srgb, var(--amber) 18%, transparent);
color: var(--amber);
}
.header-pill-loose .header-pill-count {
background: rgba(243, 139, 168, 0.18);
background: color-mix(in srgb, var(--red) 18%, transparent);
color: var(--red);
}
@ -387,14 +387,14 @@ h2, h3 {
padding-top: 0;
}
.meta { color: var(--muted); font-size: 0.85em; }
.status-online { color: var(--green); text-shadow: 0 0 6px rgba(166, 227, 161, 0.55); }
.status-needs-login { color: var(--amber); text-shadow: 0 0 6px rgba(250, 179, 135, 0.55); }
code { background: rgba(203, 166, 247, 0.12); padding: 0.05em 0.3em; border-radius: 2px; }
.status-online { color: var(--green); text-shadow: 0 0 6px color-mix(in srgb, var(--green) 55%, transparent); }
.status-needs-login { color: var(--amber); text-shadow: 0 0 6px color-mix(in srgb, var(--amber) 55%, transparent); }
code { background: color-mix(in srgb, var(--purple) 12%, transparent); padding: 0.05em 0.3em; border-radius: 2px; }
a {
color: var(--cyan);
text-shadow: 0 0 4px rgba(137, 220, 235, 0.5);
text-shadow: 0 0 4px color-mix(in srgb, var(--cyan) 50%, transparent);
}
a:hover { color: var(--fg); text-shadow: 0 0 12px rgba(137, 220, 235, 0.9); }
a:hover { color: var(--fg); text-shadow: 0 0 12px color-mix(in srgb, var(--cyan) 90%, transparent); }
.btn {
font-family: inherit;
font-size: 1em;
@ -410,7 +410,7 @@ a:hover { color: var(--fg); text-shadow: 0 0 12px rgba(137, 220, 235, 0.9); }
transition: box-shadow 0.15s ease, text-shadow 0.15s ease;
}
.btn:hover {
background: rgba(205, 214, 244, 0.06);
background: color-mix(in srgb, var(--fg) 6%, transparent);
text-shadow: 0 0 10px currentColor;
box-shadow: 0 0 10px -2px currentColor;
}
@ -712,9 +712,9 @@ pre.diff {
}
.status-badge.status-loading { color: var(--muted); border-color: var(--purple-dim); }
.status-badge.status-online { color: var(--green); border-color: var(--green);
text-shadow: 0 0 6px rgba(166, 227, 161, 0.55); }
text-shadow: 0 0 6px color-mix(in srgb, var(--green) 55%, transparent); }
.status-badge.status-rate-limited { color: var(--red); border-color: var(--red);
text-shadow: 0 0 6px rgba(243, 139, 168, 0.55); }
text-shadow: 0 0 6px color-mix(in srgb, var(--red) 55%, transparent); }
.status-badge.status-needs-login { color: var(--amber); border-color: var(--amber); }
.status-badge.status-offline { color: var(--muted); border-color: var(--muted); }
/* Orphaned tombstone `.btn-dashlink` chip that lived beside the
@ -734,7 +734,7 @@ pre.diff {
transition: box-shadow 0.15s ease, background 0.15s ease;
}
.btn-cancel-turn:hover {
background: rgba(243, 139, 168, 0.1);
background: color-mix(in srgb, var(--red) 10%, transparent);
box-shadow: 0 0 10px -2px currentColor;
}
/* Orphaned tombstone `.btn-new-session` round-pill moved into
@ -759,16 +759,16 @@ pre.diff {
}
.state-badge.state-idle {
color: var(--cyan); border-color: var(--cyan);
text-shadow: 0 0 6px rgba(137, 220, 235, 0.55);
text-shadow: 0 0 6px color-mix(in srgb, var(--cyan) 55%, transparent);
}
.state-badge.state-thinking {
color: var(--amber); border-color: var(--amber);
text-shadow: 0 0 6px rgba(250, 179, 135, 0.65);
text-shadow: 0 0 6px color-mix(in srgb, var(--amber) 65%, transparent);
animation: badge-pulse 1.8s ease-in-out infinite;
}
.state-badge.state-compacting {
color: var(--purple); border-color: var(--purple);
text-shadow: 0 0 6px rgba(203, 166, 247, 0.65);
text-shadow: 0 0 6px color-mix(in srgb, var(--purple) 65%, transparent);
animation: badge-pulse 1.8s ease-in-out infinite;
}
.state-badge.state-just-changed {
@ -841,7 +841,7 @@ pre.diff {
}
.term-input .prompt {
color: var(--green);
text-shadow: 0 0 6px rgba(166, 227, 161, 0.6);
text-shadow: 0 0 6px color-mix(in srgb, var(--green) 60%, transparent);
user-select: none;
flex: 0 0 auto;
}
@ -1113,7 +1113,7 @@ body.screen-shell {
bottom: 0; left: 0; right: 0;
max-height: 40vh;
overflow-y: auto;
background: rgba(17, 17, 27, 0.95);
background: color-mix(in srgb, var(--crust) 95%, transparent);
border-top: 1px solid var(--purple-dim);
font-size: 0.72rem;
font-family: ui-monospace, monospace;