frontend: light-theme terminal contrast, theme before first paint, color-scheme, motion and focus defaults
Light theme: the terminal and code blocks sat on --crust, a mid grey there, so text was 2:1 to 3:1. They now use --code-bg, which keeps 95% of a light palette's background (58% of the dark one's, as before); scrims and shadows keep --crust. Dark --muted goes from 4.44:1 to 4.72:1 on --bg. The stored theme and motion overrides are set by a blocking boot script in the head (the page allows no inline script), so a light OS no longer paints light before the dark default; a test keeps its keys in step with the shell. color-scheme follows the palette, so native controls and scrollbars match a forced theme. Five infinite animations (dashboard banner, container icon, pending badge, warn banner, spinner) now honour reduced motion and the in-app motion setting, ConnectionDot uses the same three-rule shape as the others, and the hive-warn element honours the system preference. Keyboard focus gets a default ring, and the cancel button and pane divider keep a visible one.
This commit is contained in:
parent
16260108ee
commit
3d88108c4f
1 changed files with 257 additions and 23 deletions
|
|
@ -33,10 +33,19 @@
|
|||
in srgb,
|
||||
var(--base00) 58%,
|
||||
#000000
|
||||
); /* terminal / code bg, below --bg */
|
||||
); /* scrims and shadows: a darkened bg, in both themes */
|
||||
/* The surface text sits on in a terminal or a code block. In the dark theme
|
||||
it is `--crust`, below `--bg`. A light palette keeps nearly all of its
|
||||
background (`--code-bg-share` in `colors.css`), as `--crust` is a mid
|
||||
grey there and the text on it fell to 2:1. */
|
||||
--code-bg: color-mix(
|
||||
in srgb,
|
||||
var(--base00) var(--code-bg-share, 58%),
|
||||
#000000
|
||||
);
|
||||
--muted: color-mix(
|
||||
in srgb,
|
||||
var(--base05) var(--muted-share, 55.5%),
|
||||
var(--base05) var(--muted-share, 58%),
|
||||
var(--base00)
|
||||
); /* secondary / dimmed text */
|
||||
--subtext0: color-mix(
|
||||
|
|
@ -46,7 +55,7 @@
|
|||
); /* toolbar/status text; dimmer than --fg, lighter than --muted */
|
||||
/* `--muted-share` and `--subtext0-share` are how much of the text colour each
|
||||
mix keeps. A palette whose background is light sets them higher in
|
||||
`colors.css`: at the dark palette's 55.5% the light one's muted text was
|
||||
`colors.css`: at the dark palette's 58% the light one's muted text was
|
||||
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. */
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue