From 5ec713634f407d352963320102308683b90df2f8 Mon Sep 17 00:00:00 2001 From: AlteredParadox <266677007+AlteredParadox@users.noreply.github.com> Date: Wed, 18 Nov 2026 20:05:38 -0600 Subject: [PATCH 1/2] Raise text contrast on filled controls and state labels fred's review of PR #18 found two pairs under WCAG's 4.5:1 for small text, both shipped in v0.3.0: - White on the accent blue (#3b82f6) is 3.68:1, and 3.18:1 on hover. Filled controls (primary buttons, the selected settings segment) now use a deeper blue, #2563eb: 5.17:1, and 4.78:1 on hover. The accent itself is unchanged for links, tags, focus rings and the brand mark. The light theme already used #2563eb; its hover no longer lightens the fill (that dipped to 4.44:1) and darkens to #1d4ed8 instead. - --dim on a panel is 2.98:1 (3.09:1 in the light theme). It labelled real states and values: scanning "off", host status "unknown", and the version string. Those now use --muted (5.92:1 dark, 5.76:1 light). --dim stays for decoration only: empty-value dashes and the unknown-status dot, which sits next to its text label. Co-Authored-By: Claude Fable 5.2 --- internal/web/static/style.css | 21 +++++++++++++++------ internal/web/templates/dashboard.html | 2 +- internal/web/templates/subnets.html | 2 +- 3 files changed, 17 insertions(+), 8 deletions(-) diff --git a/internal/web/static/style.css b/internal/web/static/style.css index 343714a..2cf81c9 100644 --- a/internal/web/static/style.css +++ b/internal/web/static/style.css @@ -44,6 +44,11 @@ --dim: #5a6272; --accent: #3b82f6; --accent-hover: #60a5fa; + /* Filled controls carry small white text, which needs 4.5:1. The accent + itself gives only 3.7:1 against white, so fills use a deeper blue + (5.2:1, 4.8:1 on hover) and --accent stays for text, lines and glows. */ + --accent-fill: #2563eb; + --accent-fill-hover: #2a6fdb; --accent-ink: #ffffff; --ok: #22c55e; --warn: #f59e0b; @@ -76,6 +81,8 @@ --dim: #8b93a3; --accent: #2563eb; --accent-hover: #1d4ed8; + --accent-fill: #2563eb; + --accent-fill-hover: #1d4ed8; --ok: #15803d; --warn: #b45309; --bad: #dc2626; @@ -128,8 +135,8 @@ button, a.btn { } button:hover, a.btn:hover { border-color: var(--accent); color: var(--text); text-decoration: none; } button:focus-visible, a:focus-visible { outline: 1px solid var(--accent); outline-offset: 1px; } -button.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 600; } -button.primary:hover { filter: brightness(1.1); color: var(--accent-ink); } +button.primary { background: var(--accent-fill); border-color: var(--accent-fill); color: var(--accent-ink); font-weight: 600; } +button.primary:hover { background: var(--accent-fill-hover); border-color: var(--accent-fill-hover); color: var(--accent-ink); } button.danger { color: var(--bad); } button.danger:hover { border-color: var(--bad); color: var(--bad); } button.small { padding: 1px 8px; font-size: 0.846rem; } @@ -142,7 +149,7 @@ button.small { padding: 1px 8px; font-size: 0.846rem; } .seg input { position: absolute; opacity: 0; pointer-events: none; } .seg span { display: block; padding: var(--ctl-y) 12px; font-size: 0.923rem; color: var(--muted); white-space: nowrap; } .seg span:hover { color: var(--text); } -.seg input:checked + span { background: var(--accent); color: var(--accent-ink); } +.seg input:checked + span { background: var(--accent-fill); color: var(--accent-ink); } .seg input:focus-visible + span { outline: 1px solid var(--text); outline-offset: -3px; } /* ---- frame ------------------------------------------------------------ */ @@ -176,7 +183,7 @@ a.brand:hover { color: var(--text); text-decoration: none; } .side-foot { display: grid; gap: 4px; margin-top: 10px; padding: 12px 10px 0; - border-top: 1px solid var(--line); font-size: 0.846rem; color: var(--dim); + border-top: 1px solid var(--line); font-size: 0.846rem; color: var(--muted); } .legal { display: flex; flex-wrap: wrap; gap: 4px 12px; } .legal a { color: var(--muted); } @@ -225,6 +232,8 @@ h2 a { letter-spacing: 0; text-transform: none; } .tile-value { margin-top: 2px; font-size: 1.46rem; font-weight: 600; line-height: 1.3; font-variant-numeric: tabular-nums; } .muted { color: var(--muted); } +/* --dim is under 3:1 on a panel: decoration only (empty-value dashes, the + unknown-status dot), never text that carries a state or a value. */ .dim { color: var(--dim); } .ok { color: var(--ok); } .warn { color: var(--warn); } @@ -322,7 +331,7 @@ tr.host-row.editing button.edit-only { display: inline-block; } .led.up, .status-up .led { background: var(--ok); box-shadow: 0 0 8px var(--ok); } .led.down, .status-down .led { background: var(--bad); box-shadow: 0 0 8px var(--bad); } .status { display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; } -.status.status-unknown { color: var(--dim); } +.status.status-unknown { color: var(--muted); } .tag { display: inline-block; margin: 1px 4px 1px 0; padding: 1px 6px; @@ -392,7 +401,7 @@ label.f { display: grid; gap: 5px; font-size: 0.846rem; color: var(--muted); } .login-card h1 { margin: 0; font-size: 1.15rem; } .login-card .flash, .login-card .info, .login-card p { margin: 0; } .login-card button { margin-top: 4px; padding-top: 8px; padding-bottom: 8px; } -.bare > .legal { justify-content: center; font-size: 0.846rem; color: var(--dim); } +.bare > .legal { justify-content: center; font-size: 0.846rem; color: var(--muted); } /* ---- narrow screens --------------------------------------------------- */ diff --git a/internal/web/templates/dashboard.html b/internal/web/templates/dashboard.html index 1d96ae9..cbdc791 100644 --- a/internal/web/templates/dashboard.html +++ b/internal/web/templates/dashboard.html @@ -47,7 +47,7 @@

Subnets

{{.Name}} {{.Hosts}} {{.Up}} / {{.Hosts}} -{{if .ScanEnabled}}on{{else}}off{{end}} +{{if .ScanEnabled}}on{{else}}off{{end}} {{.ScanIntervalSec}}s {{relTime .LastScanAt}}{{if .LastScanErr}} !{{end}} diff --git a/internal/web/templates/subnets.html b/internal/web/templates/subnets.html index 1b6a5ba..e494cbe 100644 --- a/internal/web/templates/subnets.html +++ b/internal/web/templates/subnets.html @@ -37,7 +37,7 @@ {{.CIDR}} {{.Name}} -{{if .ScanEnabled}}on{{else}}off{{end}} +{{if .ScanEnabled}}on{{else}}off{{end}} {{.ScanIntervalSec}}s {{relTime .LastScanAt}}{{if .LastScanErr}} !{{end}}
From e21aaa311ab94e844dc02281e00874f9a92f7a04 Mon Sep 17 00:00:00 2001 From: AlteredParadox <266677007+AlteredParadox@users.noreply.github.com> Date: Wed, 18 Nov 2026 20:09:13 -0600 Subject: [PATCH 2/2] Give placeholder text readable contrast too Review follow-up on PR #20: placeholders still used --dim, but they carry real hints (the CIDR format example, what the bulk value field is for). They now use --muted with opacity pinned to 1: 6.26:1 in the dark theme and 5.19:1 in the light one, measured on the rendered inputs. Co-Authored-By: Claude Fable 5.2 --- internal/web/static/style.css | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/internal/web/static/style.css b/internal/web/static/style.css index 2cf81c9..c16d3e7 100644 --- a/internal/web/static/style.css +++ b/internal/web/static/style.css @@ -124,7 +124,9 @@ input, select, textarea { } input[type="checkbox"], input[type="radio"] { width: auto; margin: 0; accent-color: var(--accent); } input:focus, select:focus, textarea:focus { outline: 1px solid var(--accent); outline-offset: 0; } -input::placeholder, textarea::placeholder { color: var(--dim); } +/* Placeholders carry real hints (the CIDR format, what the bulk value is + for), so they get readable contrast, not --dim. */ +input::placeholder, textarea::placeholder { color: var(--muted); opacity: 1; } textarea { resize: vertical; } button, a.btn { @@ -233,7 +235,7 @@ h2 a { letter-spacing: 0; text-transform: none; } .muted { color: var(--muted); } /* --dim is under 3:1 on a panel: decoration only (empty-value dashes, the - unknown-status dot), never text that carries a state or a value. */ + unknown-status dot), never text that carries a state, a value or a hint. */ .dim { color: var(--dim); } .ok { color: var(--ok); } .warn { color: var(--warn); }