From 2170ca728b495b1ae4d7bd992386699143985d01 Mon Sep 17 00:00:00 2001 From: Lilleman auf Larv Date: Sat, 31 Oct 2026 12:25:23 +0100 Subject: [PATCH] =?UTF-8?q?Answer=20stability=20round=201:=200=20?= =?UTF-8?q?=F0=9F=94=B4,=201=20=F0=9F=9F=A1=20(0=20misread);=20the=20order?= =?UTF-8?q?=20test=20requires=20both=20base=20rules,=20a=20chip's=20dot=20?= =?UTF-8?q?goes=20where=20the=20native=20box=20shows?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/css/styles.css | 8 +++++--- src/ui/stylesheet-floor.test.ts | 6 +++--- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/public/css/styles.css b/public/css/styles.css index 3ee1871..bcf2a2a 100644 --- a/public/css/styles.css +++ b/public/css/styles.css @@ -478,13 +478,15 @@ span.nav-self { cursor: default; } /* static / non-clickable */ .chip:has(input:focus-visible) { outline: 2px solid var(--focus); outline-offset: 1px; } } -/* Without :has() every branch is open and every theme rule is inert: neither control does anything. - The filter inputs stay visible, since the native control is then the only sign of a choice or of - focus. After the base rules, since @supports adds no specificity. */ +/* Without :has() every nav branch stays open and no theme rule applies, so the disclosure toggles and + the theme switch are hidden. The filter inputs are shown instead: the native control is then the + only sign of a choice or of focus, and the dot goes, since it would stay grey beside a ticked box. This block must come + after the base rules, since @supports adds no specificity. */ @supports not selector(:has(a)) { .nav-disc { visibility: hidden; } /* keeps its width, so the labels stay aligned */ .theme-switch { display: none; } .segmented input, .chip input { position: static; opacity: 1; margin: 0; } + .chip .chip-dot { display: none; } } /* date range */ diff --git a/src/ui/stylesheet-floor.test.ts b/src/ui/stylesheet-floor.test.ts index 8358043..8f6d08c 100644 --- a/src/ui/stylesheet-floor.test.ts +++ b/src/ui/stylesheet-floor.test.ts @@ -153,16 +153,16 @@ test("styles.css hides the theme switch and the nav toggles where :has() is miss assert.match(block, /\.nav-disc\s*\{\s*visibility:\s*hidden/); }); -// Both inputs are invisible in the base rules and only a `:has()` rule marks the choice, so without -// `:has()` the native control is the only sign of what is selected or focused. test("styles.css shows the segmented and chip inputs where :has() is missing, after their base rules", () => { const guard = stylesheet.indexOf("@supports not selector(:has(a)) {"); assert.ok(guard >= 0, "no @supports not selector(:has(a)) block"); const block = stylesheet.slice(guard, blockEnd(guard)); for (const input of [".segmented input", ".chip input"]) { - assert.ok(stylesheet.indexOf(`${input} {`) < guard, `the base ${input} rule comes after the guard`); + const base = stylesheet.indexOf(`${input} {`); + assert.ok(base >= 0 && base < guard, `the base ${input} rule is missing or comes after the guard`); } assert.match(block, /\.segmented input,\s*\.chip input\s*\{[^}]*position:\s*static[^}]*opacity:\s*1/); + assert.match(block, /\.chip \.chip-dot\s*\{\s*display:\s*none/); }); // Without `:has()` nothing reads #nav-toggle, so an off-canvas sidebar there is unreachable and the