frontend: one glass token pair in place of three copied light and dark blocks
Headers, badges, terminal panes, the message box and the dashboard's bars read --glass-clear and --glass-filter from theme.css; the light palette (colors.css) and the solid-backgrounds setting set them. Each surface keeps a single rule, the per-theme override blocks and the quiet-badge specificity workaround go, and the dashboard and agent page now follow the light palette like the swarm UI.
This commit is contained in:
parent
2a719a52e8
commit
1ca82b3e09
6 changed files with 93 additions and 122 deletions
|
|
@ -13,54 +13,22 @@
|
|||
font: inherit;
|
||||
font-size: 0.85em;
|
||||
line-height: 1.4;
|
||||
background: color-mix(in srgb, var(--purple-dim) 65%, transparent);
|
||||
-webkit-backdrop-filter: blur(6px) saturate(140%);
|
||||
backdrop-filter: blur(6px) saturate(140%);
|
||||
/* Frosted glass (mara: "make badges look glassy... in dark mode the added
|
||||
transparency improves readability, bg behind is dark"): translucent over a
|
||||
blur on the dark palette, solid on the light one (see `--glass-clear` in
|
||||
theme.css). Same recipe as the header, the terminal panes and the message
|
||||
box. */
|
||||
background: color-mix(
|
||||
in srgb,
|
||||
var(--purple-dim) calc(100% - 35% * var(--glass-clear)),
|
||||
transparent
|
||||
);
|
||||
-webkit-backdrop-filter: var(--glass-filter);
|
||||
backdrop-filter: var(--glass-filter);
|
||||
color: var(--fg);
|
||||
border: none;
|
||||
white-space: nowrap;
|
||||
}
|
||||
/* Frosted-glass fill (mara: "make badges look glassy... in dark mode
|
||||
the added transparency improves readability, bg behind is dark") —
|
||||
same recipe as the header chrome/terminal glass (`chrome.css`,
|
||||
`terminal.css`): translucent `color-mix` + `backdrop-filter`. Only
|
||||
for the default filled badges — `variant="quiet"` (below) already
|
||||
has no fill at all, nothing to frost.
|
||||
Dark (mocha) only, deliberately: her own reasoning was conditioned
|
||||
on a dark surface behind the badge. A light (latte) page has bright,
|
||||
often busy content behind a badge — the same transparency would
|
||||
wash out the value text instead of improving it, the opposite of
|
||||
what this is for — so light mode keeps the plain solid fill. Same
|
||||
three-way structure `colors.css` uses for every light/dark switch:
|
||||
this default rule *is* the dark look (mocha is the default palette),
|
||||
the `@media`/`:root[data-theme]` blocks below revert it for light,
|
||||
restore it for an explicit dark override. */
|
||||
@media (prefers-color-scheme: light) {
|
||||
.ui-badge {
|
||||
background: var(--purple-dim);
|
||||
-webkit-backdrop-filter: none;
|
||||
backdrop-filter: none;
|
||||
}
|
||||
}
|
||||
/* `:not(.ui-badge-quiet)` here, unlike the base rule/`@media` block
|
||||
above — argus's review: both of these add `:root`+`[data-theme]` to
|
||||
the selector, so specificity is 0-3-0 vs plain `.ui-badge-quiet`'s
|
||||
0-1-0. Without the exclusion these would beat quiet's `background:
|
||||
none` (below) whenever a user has an *explicit* theme override set
|
||||
(SettingsMenu's dropdown, not just the OS default), reintroducing
|
||||
the settings/links "should not have the badge bg" bug on those
|
||||
triggers. Verified against a real repro before landing, not just
|
||||
the specificity arithmetic. */
|
||||
:root[data-theme="light"] .ui-badge:not(.ui-badge-quiet) {
|
||||
background: var(--purple-dim);
|
||||
-webkit-backdrop-filter: none;
|
||||
backdrop-filter: none;
|
||||
}
|
||||
:root[data-theme="dark"] .ui-badge:not(.ui-badge-quiet) {
|
||||
background: color-mix(in srgb, var(--purple-dim) 65%, transparent);
|
||||
-webkit-backdrop-filter: blur(6px) saturate(140%);
|
||||
backdrop-filter: blur(6px) saturate(140%);
|
||||
}
|
||||
/* The base `.ui-badge` rule's `border-radius: 1em` is a genuine pill at
|
||||
its own compact display-only height, but `min-height: 2.75em` below
|
||||
(the WCAG 2.5.5 touch-target floor) makes an *interactive* badge tall
|
||||
|
|
@ -92,6 +60,8 @@
|
|||
the idle background, which is what mara's report was actually about. */
|
||||
.ui-badge-quiet {
|
||||
background: none;
|
||||
-webkit-backdrop-filter: none;
|
||||
backdrop-filter: none;
|
||||
}
|
||||
.ui-badge-interactive[aria-expanded="true"] {
|
||||
background: var(--bg-elev);
|
||||
|
|
|
|||
|
|
@ -16,9 +16,13 @@
|
|||
.page-header {
|
||||
/* Stickiness lives on the `.sticky-top` wrapper (common.css) that
|
||||
common.js wraps this header in. */
|
||||
background: color-mix(in srgb, var(--bg) 92%, transparent);
|
||||
-webkit-backdrop-filter: blur(8px) saturate(120%);
|
||||
backdrop-filter: blur(8px) saturate(120%);
|
||||
background: color-mix(
|
||||
in srgb,
|
||||
var(--bg) calc(100% - 8% * var(--glass-clear)),
|
||||
transparent
|
||||
);
|
||||
-webkit-backdrop-filter: var(--glass-filter);
|
||||
backdrop-filter: var(--glass-filter);
|
||||
border-bottom: 1px solid var(--purple-dim);
|
||||
display: flex;
|
||||
/* Keep the back-link + sub-tab nav on one row. Without an explicit
|
||||
|
|
|
|||
|
|
@ -135,6 +135,9 @@
|
|||
--muted-share: 85%;
|
||||
--subtext0-share: 93%;
|
||||
--code-bg-share: 95%;
|
||||
/* No frosted glass on the light palette: see `--glass-clear` in theme.css. */
|
||||
--palette-glass-clear: 0;
|
||||
--palette-glass-filter: none;
|
||||
color-scheme: light;
|
||||
}
|
||||
}
|
||||
|
|
@ -171,6 +174,8 @@
|
|||
--muted-share: 85%;
|
||||
--subtext0-share: 93%;
|
||||
--code-bg-share: 95%;
|
||||
--palette-glass-clear: 0;
|
||||
--palette-glass-filter: none;
|
||||
color-scheme: light;
|
||||
}
|
||||
:root[data-theme="dark"] {
|
||||
|
|
@ -195,5 +200,7 @@
|
|||
--muted-share: 58%;
|
||||
--subtext0-share: 77.7%;
|
||||
--code-bg-share: 58%;
|
||||
--palette-glass-clear: initial;
|
||||
--palette-glass-filter: initial;
|
||||
color-scheme: dark;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,25 +1,9 @@
|
|||
/* The frosted surfaces, made opaque while `data-solid="true"` is on `<html>`
|
||||
(`solid-backgrounds.tsx`). Each rule names the same surface as the rule that
|
||||
makes it see-through, with `html:root` in front so it outranks that rule's
|
||||
theme variants whatever order the stylesheets load in. The dialog scrim is
|
||||
left alone: it dims the page on purpose. */
|
||||
html:root[data-solid="true"] .shell-header {
|
||||
background: var(--bg-elev);
|
||||
-webkit-backdrop-filter: none;
|
||||
backdrop-filter: none;
|
||||
}
|
||||
html:root[data-solid="true"] .ui-badge:not(.ui-badge-quiet) {
|
||||
background: var(--purple-dim);
|
||||
-webkit-backdrop-filter: none;
|
||||
backdrop-filter: none;
|
||||
}
|
||||
html:root[data-solid="true"] .terminal-wrap {
|
||||
background: var(--code-bg);
|
||||
-webkit-backdrop-filter: none;
|
||||
backdrop-filter: none;
|
||||
}
|
||||
html:root[data-solid="true"] .ui-agent-input-form {
|
||||
background: var(--bg-elev);
|
||||
-webkit-backdrop-filter: none;
|
||||
backdrop-filter: none;
|
||||
(`solid-backgrounds.tsx`): the two glass tokens of `theme.css` go to solid,
|
||||
and every glass surface follows. `html:root` outranks theme.css's `:root`
|
||||
whatever order the stylesheets load in. The dialog scrim is left alone: it
|
||||
dims the page on purpose. */
|
||||
html:root[data-solid="true"] {
|
||||
--glass-clear: 0;
|
||||
--glass-filter: none;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -18,9 +18,13 @@
|
|||
|
||||
.terminal-wrap {
|
||||
position: relative;
|
||||
background: color-mix(in srgb, var(--code-bg) 78%, transparent);
|
||||
-webkit-backdrop-filter: blur(8px) saturate(120%);
|
||||
backdrop-filter: blur(8px) saturate(120%);
|
||||
background: color-mix(
|
||||
in srgb,
|
||||
var(--code-bg) calc(100% - 22% * var(--glass-clear)),
|
||||
transparent
|
||||
);
|
||||
-webkit-backdrop-filter: var(--glass-filter);
|
||||
backdrop-filter: var(--glass-filter);
|
||||
border: 1px solid var(--purple-dim);
|
||||
box-shadow: inset 0 0 24px rgba(0, 0, 0, 0.7);
|
||||
border-radius: 4px;
|
||||
|
|
|
|||
|
|
@ -59,6 +59,17 @@
|
|||
2.4:1 against its card background, short of the 4.5:1 AA asks for. A palette
|
||||
that sets neither keeps the shares above. */
|
||||
|
||||
/* The frosted-glass surfaces (headers, badges, terminal panes, the message
|
||||
box) are see-through over a blur on the dark palette and solid on the light
|
||||
one, where bright content behind them would wash the text out.
|
||||
`--glass-clear` is 1 for glass and 0 for solid; a surface keeps
|
||||
`calc(100% - its-clear-share * var(--glass-clear))` of its fill colour, and
|
||||
`--glass-filter` is its `backdrop-filter`. A light palette sets
|
||||
`--palette-glass-clear` and `--palette-glass-filter` in `colors.css`, and
|
||||
the solid-backgrounds setting sets the two final tokens itself. */
|
||||
--glass-clear: var(--palette-glass-clear, 1);
|
||||
--glass-filter: var(--palette-glass-filter, blur(8px) saturate(130%));
|
||||
|
||||
/* `--muted`, above, is mixed toward `--base00`/`--bg` — correct for
|
||||
dimmed text on the page background, wrong for dimmed text sitting on
|
||||
an elevated fill like `--purple-dim` (badge/dropdown-item
|
||||
|
|
|
|||
Loading…
Reference in a new issue