Files
pipdock/ui/src/styles.css
T
poli0981andClaude Fable 5.2 d016b80014 fix(a11y): name dialogs by their heading, and four smaller things
A PdDialog's name was an aria-label holding what it was about, so a screen
reader announced "numpy, dialog" and then "Cancel": the question being asked
was on screen and never spoken. It is named by its visible heading, followed by
what it is about, and described by its body.

The legal gate replaces the whole shell, declares itself modal, and had no
focus inside it. Its heading takes focus on arrival, as a screen's does.

A package row's focus ring was drawn 2px outside a row that is absolutely
positioned in a scroller and stacked against its neighbours, so three sides of
it were clipped or painted over. It sits inside the row, in every mode rather
than only in forced-colors.

The dock bay's remove button was a bare glyph about 8px wide. It is 24px each
way.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-10 20:01:03 +07:00

181 lines
6.5 KiB
CSS
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
@import 'tailwindcss';
/* The two faces UI-SPEC §2 names, vendored rather than fetched.
*
* `--font-sans` and `--font-mono` below have named Inter and JetBrains Mono since the tokens were
* written, and both fell through to a system fallback the whole time, because no face was ever
* registered. These are the registrations; the `@theme` block is unchanged.
*
* Committed as two files rather than added as `@fontsource-*` devDependencies: the app runs behind
* a strict CSP with no external hosts, so a CDN is not an option, and two binaries carry no
* `npm audit` surface to maintain forever. Provenance and SHA-256 for both are in
* `legal/fonts/PROVENANCE.txt`, with the OFL text beside them — SIL OFL 1.1 permits the bundling
* and requires the licence to travel with it.
*
* `font-display: swap` on purpose: the shell renders in the fallback for the first frame rather
* than showing nothing. UI-SPEC §7's "never spinners longer than 300 ms without text" is the same
* instinct — blank is worse than approximate.
*/
@font-face {
font-family: 'Inter';
font-style: normal;
/* One variable file covering the whole range, so weights need no extra requests. */
font-weight: 100 900;
font-display: swap;
src: url('./assets/fonts/InterVariable.woff2') format('woff2');
}
@font-face {
font-family: 'JetBrains Mono';
font-style: normal;
font-weight: 400;
font-display: swap;
src: url('./assets/fonts/JetBrainsMono-Regular.woff2') format('woff2');
}
/* Design tokens — UI-SPEC §2, "dark terminal-tech".
*
* Restrained phosphor-green on near-black, monospace where data lives, one accent doing real
* work. Anti-goals from that section: gradients-everywhere SaaS look, rounded-blob cards,
* decorative glow. Any glow is functional (focus rings, live-activity pulse) and subtle.
*
* Every text/surface pair here is asserted at WCAG AA by the contrast test in
* ui/src/tokens.test.ts (TESTING L3).
*/
@theme {
--color-bg: #0a0e0c;
--color-surface: #101612;
--color-surface-2: #161e18;
--color-border: #1f2b23;
--color-accent: #4ade80;
--color-accent-dim: #22935b;
--color-text: #e7f0ea;
--color-text-dim: #8aa394;
--color-warn: #f5b94a;
--color-danger: #f26a63;
--color-info: #5bc0de;
--font-sans: 'Inter', system-ui, sans-serif;
--font-mono: 'JetBrains Mono', ui-monospace, monospace;
--text-base: 0.875rem; /* 14px UI */
--text-data: 0.8125rem; /* 13px mono data */
--radius-pd: 6px;
/* The content column's widest. The window may be maximized (UI-SPEC §5); the column is what
stops a table from stretching across a 4K panel. */
--container-content: 87.5rem;
/* UI-SPEC §2: motion is 120–160 ms ease-out. */
--ease-pd: cubic-bezier(0.16, 1, 0.3, 1);
}
@layer base {
html,
body,
#root {
height: 100%;
}
body {
background-color: var(--color-bg);
color: var(--color-text);
font-family: var(--font-sans);
font-size: var(--text-base);
}
/* UI-SPEC §8: the focus ring is 2px accent and is never removed. */
:focus-visible {
outline: 2px solid var(--color-accent);
outline-offset: 2px;
}
/* A package row's ring sits inside it. Rows are absolutely positioned inside a scroller and
* stacked edge to edge, so a ring drawn 2px outside one is clipped by the scroller at both
* ends and painted over by the row below — three sides of the ring a keyboard user steers by.
* This was in the forced-colors block alone, where the same clipping had been noticed. */
[role='row']:focus-visible {
outline-offset: -2px;
}
/* UI-SPEC §2: prefers-reduced-motion is respected. */
@media (prefers-reduced-motion: reduce) {
*,
*::before,
*::after {
animation-duration: 0.01ms !important;
animation-iteration-count: 1 !important;
transition-duration: 0.01ms !important;
}
}
/* UI-SPEC §8: Windows high-contrast mode falls back to system colors.
*
* Forced-colors does not *ignore* the palette — it overrides the properties it knows about and
* leaves the rest, so a token still resolves and still loses. Rebinding every `--color-*` to a
* system keyword is what makes the whole app follow, rather than the handful of properties the
* UA happens to force.
*
* Two cases the UA cannot rescue on its own, both load-bearing:
*
* - **A tinted background carries no meaning here.** `bg-danger/20` on *Force latest* and on
* *Remove anyway* is erased, leaving them visually identical to Cancel — a destructive button
* that looks like the safe one. They get a border instead, which forced-colors keeps.
* - **Selection is a background too.** A selected row is `bg-surface-2`, which flattens into
* every other row; an outline survives.
*/
@media (forced-colors: active) {
:root {
--color-bg: Canvas;
--color-surface: Canvas;
--color-surface-2: Canvas;
--color-border: CanvasText;
--color-text: CanvasText;
--color-text-dim: GrayText;
--color-accent: LinkText;
--color-accent-dim: LinkText;
/* No system keyword means "warning" or "danger", so both take the one that means
* "this is not ordinary text" rather than pretending to a distinction the mode does not
* have. The copy already says which is which. */
--color-warn: CanvasText;
--color-danger: CanvasText;
--color-info: CanvasText;
}
body {
background-color: Canvas;
color: CanvasText;
}
/* The focus ring UI-SPEC §8 says is never removed. */
:focus-visible {
outline: 2px solid Highlight;
outline-offset: 2px;
}
/* A row's focus ring sits inside it, or the virtualizer's absolute positioning clips it. */
[role='row']:focus-visible {
outline-offset: -2px;
}
/* `page` is the sidebar's active tab. The rule matched `'true'` alone, so the one thing that
* said which screen is showing was drawn like every other tab. */
[aria-selected='true'],
[aria-current='true'],
[aria-current='page'] {
outline: 1px solid Highlight;
}
/* Destructive controls, which are otherwise indistinguishable once their tint is dropped.
*
* One attribute, not a list of `data-action` values. The list was five names long and missed
* Remove, Allow, Clear, the Force-latest confirm and a forced plan's Confirm for as long as it
* existed (U45) — a list of names beside a list of buttons is two lists. `destructive.test.ts`
* holds the other half: every button drawn in the danger colour carries the attribute. */
button[data-destructive] {
border: 2px solid CanvasText;
}
}
}