From 8969bee6a9adfd052d1be3633db0672b8b641a7e Mon Sep 17 00:00:00 2001 From: Joseph Doherty Date: Fri, 13 Nov 2026 15:36:57 -0500 Subject: [PATCH] fix(theme): make shared status and supporting text readable --- .../ZB.MOM.WW.Theme/wwwroot/css/layout.css | 6 +- .../src/ZB.MOM.WW.Theme/wwwroot/css/theme.css | 44 +- .../StaticAssetsTests.cs | 4 +- .../ThemeTokenContrastTests.cs | 62 ++ components/ui-theme/spec/DESIGN-TOKENS.md | 45 +- .../validation/theme-1.0.0/contrast-green.log | 8 + .../validation/theme-1.0.0/contrast-red.log | 138 ++++ .../validation/theme-1.0.0/contrast.md | 7 + .../theme-1.0.0/tests/theme-components.trx | 634 ++++++++++++++++++ .../theme-1.0.0/token-contrast.json | 41 ++ 10 files changed, 950 insertions(+), 39 deletions(-) create mode 100644 ZB.MOM.WW.Theme/tests/ZB.MOM.WW.Theme.Tests/ThemeTokenContrastTests.cs create mode 100644 components/ui-theme/validation/theme-1.0.0/contrast-green.log create mode 100644 components/ui-theme/validation/theme-1.0.0/contrast-red.log create mode 100644 components/ui-theme/validation/theme-1.0.0/contrast.md create mode 100644 components/ui-theme/validation/theme-1.0.0/tests/theme-components.trx create mode 100644 components/ui-theme/validation/theme-1.0.0/token-contrast.json diff --git a/ZB.MOM.WW.Theme/src/ZB.MOM.WW.Theme/wwwroot/css/layout.css b/ZB.MOM.WW.Theme/src/ZB.MOM.WW.Theme/wwwroot/css/layout.css index 09a4ef2..9706982 100644 --- a/ZB.MOM.WW.Theme/src/ZB.MOM.WW.Theme/wwwroot/css/layout.css +++ b/ZB.MOM.WW.Theme/src/ZB.MOM.WW.Theme/wwwroot/css/layout.css @@ -356,7 +356,7 @@ .rail-section:not([open]) > .rail-section-body { display: none; } /* StatusPill: info variant (on-palette, reuses the info blue wash) */ -.chip-info { color: var(--accent-deep); background: var(--info-bg); border-color: var(--info-border); } +.chip-info { color: var(--info-ink); background: var(--info-bg); border-color: var(--info-border); } /* TechCard body/footer padding; TechField error; LoginCard body */ .panel-body { padding: 0.85rem 0.9rem; } @@ -395,14 +395,14 @@ display: inline-block; min-width: 1.4rem; text-align: center; font-family: var(--mono); font-size: 0.72rem; font-weight: 600; padding: 0.05rem 0.35rem; border-radius: 999px; - color: var(--bad); background: var(--bad-bg); border: 1px solid var(--bad-border); + color: var(--bad-ink); background: var(--bad-bg); border: 1px solid var(--bad-border); } .count-badge.warn { color: var(--warn-ink); background: var(--warn-bg); border-color: var(--warn-border); } /* ── Inline notice, info variant ───────────────────────────────────────────── Theme 0.3.1 ships `.notice` (amber) but no variants; `.info` re-tints it to the on-palette blue wash. `--info-bg`/`--info-border` come from the theme. */ -.notice.info { color: var(--accent-deep); background: var(--info-bg); border-color: var(--info-border); } +.notice.info { color: var(--info-ink); background: var(--info-bg); border-color: var(--info-border); } /* ── Table row-action cell ───────────────────────────────────────────────── The bare class is what the mockup ships and what a `` diff --git a/ZB.MOM.WW.Theme/src/ZB.MOM.WW.Theme/wwwroot/css/theme.css b/ZB.MOM.WW.Theme/src/ZB.MOM.WW.Theme/wwwroot/css/theme.css index 4b6d05f..2934ffd 100644 --- a/ZB.MOM.WW.Theme/src/ZB.MOM.WW.Theme/wwwroot/css/theme.css +++ b/ZB.MOM.WW.Theme/src/ZB.MOM.WW.Theme/wwwroot/css/theme.css @@ -42,7 +42,7 @@ --card: #ffffff; /* raised surfaces: cards, bars, table heads */ --ink: #1b1d21; /* primary text */ --ink-soft: #5a6066; /* secondary text, labels */ - --ink-faint: #8b9097; /* tertiary text, captions, units */ + --ink-faint: #626970; /* tertiary text, captions, units */ --rule: #e4e4df; /* hairline borders / row dividers */ --rule-strong: #d2d2cb; /* emphasised hairlines: bar underline, pills */ @@ -50,13 +50,18 @@ --accent: #2f5fd0; /* links, sort arrows, primary actions */ --accent-deep: #1e3f99; /* hover / pressed accent, raw-value emphasis */ - /* Status — foreground */ + /* Status — signals (dots, stripes and charts; use semantic inks for text) */ --ok: #2f9e44; --warn: #e8920c; --bad: #e03131; --idle: #868e96; - /* Status — tinted backgrounds (pair with the matching foreground) */ + /* Status — readable text inks, paired with the matching tinted surface */ + --ok-ink: #236f34; + --bad-ink: #b42121; + --idle-ink: #535d66; + + /* Status — tinted backgrounds (pair with the matching text ink) */ --ok-bg: #e9f6ec; --warn-bg: #fdf1dd; --bad-bg: #fceaea; @@ -73,10 +78,11 @@ /* Warning ink — a deeper amber than --warn, for chip/notice/value text that needs more contrast on the warm tint than the pure --warn would give. */ - --warn-ink: #b56a00; + --warn-ink: #855000; --warn-ink-deep: #8a5a00; /* Info / accent tint — on-palette blue wash (StatusPill Info, dir-read tag) */ + --info-ink: #1e3f99; /* semantic blue, independent of product accent */ --info-bg: #e7ecfb; --info-border: #cdd9f7; @@ -165,21 +171,21 @@ a:hover { color: var(--accent-deep); text-decoration: underline; } width: 7px; height: 7px; border-radius: 50%; background: var(--idle); } -.conn-pill[data-state="connected"] { color: var(--ok); border-color: var(--ok-border-soft); background: var(--ok-bg); } +.conn-pill[data-state="connected"] { color: var(--ok-ink); border-color: var(--ok-border-soft); background: var(--ok-bg); } .conn-pill[data-state="connected"] .dot { background: var(--ok); } -.conn-pill[data-state="connecting"] { color: var(--warn); border-color: var(--warn-border-soft); background: var(--warn-bg); } +.conn-pill[data-state="connecting"] { color: var(--warn-ink); border-color: var(--warn-border-soft); background: var(--warn-bg); } .conn-pill[data-state="connecting"] .dot { background: var(--warn); animation: pulse 1.1s ease-in-out infinite; } -.conn-pill[data-state="disconnected"] { color: var(--bad); border-color: var(--bad-border-soft); background: var(--bad-bg); } +.conn-pill[data-state="disconnected"] { color: var(--bad-ink); border-color: var(--bad-border-soft); background: var(--bad-bg); } .conn-pill[data-state="disconnected"] .dot { background: var(--bad); } @keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.25; } } /* ── Status text helpers ───────────────────────────────────────────────────── Recolour a value in place — counts, ratios, error totals. */ -.s-ok { color: var(--ok); } -.s-warn { color: var(--warn); } -.s-bad { color: var(--bad); } -.s-idle { color: var(--idle); } +.s-ok { color: var(--ok-ink); } +.s-warn { color: var(--warn-ink); } +.s-bad { color: var(--bad-ink); } +.s-idle { color: var(--idle-ink); } /* ── State chip ────────────────────────────────────────────────────────────── Compact rectangular badge for an enumerated state (bound/recovering/…). @@ -194,10 +200,10 @@ a:hover { color: var(--accent-deep); text-decoration: underline; } border-radius: 4px; border: 1px solid transparent; } -.chip-ok { color: var(--ok); background: var(--ok-bg); border-color: var(--ok-border); } +.chip-ok { color: var(--ok-ink); background: var(--ok-bg); border-color: var(--ok-border); } .chip-warn { color: var(--warn-ink); background: var(--warn-bg); border-color: var(--warn-border); } -.chip-bad { color: var(--bad); background: var(--bad-bg); border-color: var(--bad-border); } -.chip-idle { color: var(--idle); background: var(--idle-bg); border-color: var(--rule-strong); } +.chip-bad { color: var(--bad-ink); background: var(--bad-bg); border-color: var(--bad-border); } +.chip-idle { color: var(--idle-ink); background: var(--idle-bg); border-color: var(--rule-strong); } /* ── Panel — the base raised surface ───────────────────────────────────────── A white card with a hairline border and 8px radius. .panel-head is the @@ -272,7 +278,7 @@ a:hover { color: var(--accent-deep); text-decoration: underline; } color: var(--ink-faint); } .agg-card.alert { border-color: var(--bad-border); background: var(--bad-bg); } -.agg-card.alert .agg-value { color: var(--bad); } +.agg-card.alert .agg-value { color: var(--bad-ink); } .agg-card.caution { border-color: var(--warn-border); background: var(--warn-bg); } .agg-card.caution .agg-value { color: var(--warn-ink); } @@ -308,9 +314,9 @@ a:hover { color: var(--accent-deep); text-decoration: underline; } font-variant-numeric: tabular-nums; text-align: right; } -.kv .v.warn { color: var(--warn); } -.kv .v.bad { color: var(--bad); } -.kv .v.ok { color: var(--ok); } +.kv .v.warn { color: var(--warn-ink); } +.kv .v.bad { color: var(--bad-ink); } +.kv .v.ok { color: var(--ok-ink); } /* ── Toolbar ───────────────────────────────────────────────────────────────── Filter/search row that sits inside a .panel above a table. */ @@ -388,7 +394,7 @@ a:hover { color: var(--accent-deep); text-decoration: underline; } padding: 0.1rem 0.4rem; border-radius: 3px; } -.dir-read { color: var(--accent-deep); background: var(--info-bg); } +.dir-read { color: var(--info-ink); background: var(--info-bg); } .dir-write { color: var(--warn-ink-deep); background: var(--warn-bg); } /* ── Inline notice ─────────────────────────────────────────────────────────── diff --git a/ZB.MOM.WW.Theme/tests/ZB.MOM.WW.Theme.Tests/StaticAssetsTests.cs b/ZB.MOM.WW.Theme/tests/ZB.MOM.WW.Theme.Tests/StaticAssetsTests.cs index 148e164..3728be5 100644 --- a/ZB.MOM.WW.Theme/tests/ZB.MOM.WW.Theme.Tests/StaticAssetsTests.cs +++ b/ZB.MOM.WW.Theme/tests/ZB.MOM.WW.Theme.Tests/StaticAssetsTests.cs @@ -102,11 +102,11 @@ public class StaticAssetsTests // Theme-002: .chip-idle pairs the idle background with the matching --idle // foreground token (per DESIGN-TOKENS.md), not --ink-soft. [Fact] - public void ChipIdle_pairs_idle_foreground_with_idle_background() + public void ChipIdle_pairs_readable_idle_ink_with_idle_background() { var css = File.ReadAllText(Path.Combine(Wwwroot, "css", "theme.css")); var rule = Regex.Match(css, @"\.chip-idle\s*\{[^}]*\}").Value; - Assert.Contains("color: var(--idle)", rule); + Assert.Contains("color: var(--idle-ink)", rule); Assert.Contains("background: var(--idle-bg)", rule); Assert.DoesNotContain("--ink-soft", rule); } diff --git a/ZB.MOM.WW.Theme/tests/ZB.MOM.WW.Theme.Tests/ThemeTokenContrastTests.cs b/ZB.MOM.WW.Theme/tests/ZB.MOM.WW.Theme.Tests/ThemeTokenContrastTests.cs new file mode 100644 index 0000000..3bb959a --- /dev/null +++ b/ZB.MOM.WW.Theme/tests/ZB.MOM.WW.Theme.Tests/ThemeTokenContrastTests.cs @@ -0,0 +1,62 @@ +using System.Globalization; +using System.Text.RegularExpressions; + +namespace ZB.MOM.WW.Theme.Tests; + +public sealed class ThemeTokenContrastTests +{ + private static string Css => File.ReadAllText(Path.GetFullPath(Path.Combine( + AppContext.BaseDirectory, "..", "..", "..", "..", "..", + "src", "ZB.MOM.WW.Theme", "wwwroot", "css", "theme.css"))); + + private static string Token(string name) + { + var match = Regex.Match(Css, Regex.Escape(name) + @"\s*:\s*(#[0-9a-fA-F]{6})\s*;"); + Assert.True(match.Success, $"Missing hex token {name}"); + return match.Groups[1].Value; + } + + private static double Luminance(string hex) + { + double Channel(int start) + { + var value = int.Parse(hex.Substring(start, 2), NumberStyles.HexNumber, + CultureInfo.InvariantCulture) / 255d; + return value <= .04045 ? value / 12.92 : Math.Pow((value + .055) / 1.055, 2.4); + } + return .2126 * Channel(1) + .7152 * Channel(3) + .0722 * Channel(5); + } + + private static double Ratio(string a, string b) + { + var x = Luminance(a); + var y = Luminance(b); + return (Math.Max(x, y) + .05) / (Math.Min(x, y) + .05); + } + + [Theory] + [InlineData("--ok-ink", "--ok-bg")] + [InlineData("--warn-ink", "--warn-bg")] + [InlineData("--bad-ink", "--bad-bg")] + [InlineData("--idle-ink", "--idle-bg")] + [InlineData("--info-ink", "--info-bg")] + [InlineData("--ink-faint", "--paper")] + [InlineData("--ink-faint", "--card")] + [InlineData("--ok-ink", "--paper")] + [InlineData("--warn-ink", "--paper")] + [InlineData("--bad-ink", "--paper")] + [InlineData("--idle-ink", "--paper")] + [InlineData("--ok-ink", "--card")] + [InlineData("--warn-ink", "--card")] + [InlineData("--bad-ink", "--card")] + [InlineData("--idle-ink", "--card")] + public void Small_text_pairs_meet_AA(string foreground, string background) + { + var ratio = Ratio(Token(foreground), Token(background)); + Assert.True(ratio >= 4.5, $"{foreground} on {background}: {ratio:F2}:1, requires 4.5:1"); + } + + [Fact] + public void Contrast_reference_is_black_on_white() => + Assert.Equal(21d, Ratio("#000000", "#ffffff"), 6); +} diff --git a/components/ui-theme/spec/DESIGN-TOKENS.md b/components/ui-theme/spec/DESIGN-TOKENS.md index fb89ffb..62beb9a 100644 --- a/components/ui-theme/spec/DESIGN-TOKENS.md +++ b/components/ui-theme/spec/DESIGN-TOKENS.md @@ -2,11 +2,10 @@ Canonical reference for every CSS custom property declared in `theme.css`. This is the human-readable index of the Technical-Light design system. The authoritative source is -`ZB.MOM.WW.Theme/src/ZB.MOM.WW.Theme/wwwroot/css/theme.css` (verified 2026-06-01, -379 lines). Analogous to [`../auth/spec/CANONICAL-ROLES.md`](../../auth/spec/CANONICAL-ROLES.md) +`ZB.MOM.WW.Theme/src/ZB.MOM.WW.Theme/wwwroot/css/theme.css` (updated for the 1.0.0 candidate, November 13, 2026). Analogous to [`../auth/spec/CANONICAL-ROLES.md`](../../auth/spec/CANONICAL-ROLES.md) for the auth component. -The token block lives in `:root` (lines 39–77). Components reference these tokens — +The canonical token block lives in `:root`. Components reference these tokens — **no hardcoded hex values** appear in component markup or CSS. The only per-app override is `--accent` on the `ThemeShell` root element via the `Accent` parameter. @@ -27,7 +26,7 @@ is `--accent` on the `ThemeShell` root element via the `Accent` parameter. |---|---|---| | `--ink` | `#1b1d21` | Primary text | | `--ink-soft` | `#5a6066` | Secondary text, form labels | -| `--ink-faint` | `#8b9097` | Tertiary text, captions, units, nav eyebrow labels | +| `--ink-faint` | `#626970` | Supporting text, captions, units and navigation labels | --- @@ -53,21 +52,37 @@ is `--accent` on the `ThemeShell` root element via the `Accent` parameter. --- -## Status tokens — foreground +## Status tokens — signals and readable text | Token | Value | Role | |---|---|---| -| `--ok` | `#2f9e44` | Success / healthy / connected state text + icon color | -| `--warn` | `#e8920c` | Warning / degraded state text + icon color | -| `--bad` | `#e03131` | Error / faulted / disconnected state text + icon color | -| `--idle` | `#868e96` | Unknown / offline / neutral state text + icon color | +| `--ok` | `#2f9e44` | Success / healthy / connected dots, stripes and charts | +| `--warn` | `#e8920c` | Warning / degraded dots, stripes and charts | +| `--bad` | `#e03131` | Error / faulted / disconnected dots, stripes and charts | +| `--idle` | `#868e96` | Unknown / offline / neutral dots, stripes and charts | --- +## Semantic text inks + +| Token | Value | Role | +|---|---|---| +| `--ok-ink` | `#236f34` | Success/connected text | +| `--warn-ink` | `#855000` | Warning/degraded text | +| `--bad-ink` | `#b42121` | Fault/error text | +| `--idle-ink` | `#535d66` | Unknown/idle text | +| `--info-ink` | `#1e3f99` | Informational blue independent of product accent | +| `--warn-ink-deep` | `#8a5a00` | Existing deep warning emphasis | + +`.s-*`, `.chip-*`, connection labels, counts and key/value text use semantic inks. +Dots retain the original saturated signal colors. Status labels remain textual; color +supplements their meaning. Normal-size text requires at least 4.5:1 on its actual surface. +Consumer opacity and local overrides must be checked in the browser as well as token math. + ## Status tokens — tinted backgrounds -Pair each with the matching foreground token above (e.g. `--ok-bg` background with `--ok` -foreground text). Used by `.chip-ok`, `.chip-warn`, `.chip-bad`, `.chip-idle` classes. +Pair each with the matching readable ink (e.g. `--ok-bg` background with `--ok-ink` +foreground text). Keep saturated signal tokens for non-text indicators. Used by `.chip-ok`, `.chip-warn`, `.chip-bad`, `.chip-idle` classes. | Token | Value | Role | |---|---|---| @@ -77,7 +92,7 @@ foreground text). Used by `.chip-ok`, `.chip-warn`, `.chip-bad`, `.chip-idle` cl | `--idle-bg` | `#eef0f2` | Idle/neutral tinted background | > The `Info` status variant (`StatusState.Info`, `chip-info`) is defined in `layout.css` -> (not `theme.css`) and uses `--accent-deep` foreground on `#e7ecfb` background. +> (not `theme.css`) and uses independent blue `--info-ink` on `--info-bg` (`#e7ecfb`). --- @@ -116,8 +131,8 @@ inherit the Technical-Light aesthetic. They are **harmless if Bootstrap is absen classes (`.s-ok`, `.s-warn`, `.s-bad`, `.s-idle`, `.chip-*`, `.kv .v.*`). 2. **One per-app override only.** Override `--accent` via `ThemeShell`'s `Accent` parameter. Do not override other tokens per-app. -3. **Status is colour, not iconography.** The status palette (`--ok`, `--warn`, `--bad`, - `--idle`) is the canonical way to communicate state. Use `StatusPill` for chips; use - `.s-*` utility classes for inline text. +3. **Status has text as well as color.** Use semantic inks for labels and values; retain + signal colors for dots/stripes/charts. Use `StatusPill` for labeled chips and `.s-*` + utility classes for inline text. Do not rely on color alone. 4. **Token changes are breaking.** Renaming or removing a token requires a SemVer major bump of `ZB.MOM.WW.Theme` and a coordinated update in every consumer app. diff --git a/components/ui-theme/validation/theme-1.0.0/contrast-green.log b/components/ui-theme/validation/theme-1.0.0/contrast-green.log new file mode 100644 index 0000000..85fa748 --- /dev/null +++ b/components/ui-theme/validation/theme-1.0.0/contrast-green.log @@ -0,0 +1,8 @@ + Determining projects to restore... + All projects are up-to-date for restore. + ZB.MOM.WW.Theme -> /Users/dohertj2/.codex/worktrees/scada-ui-consistency/scadaproj/ZB.MOM.WW.Theme/src/ZB.MOM.WW.Theme/bin/Release/net10.0/ZB.MOM.WW.Theme.dll + ZB.MOM.WW.Theme.Tests -> /Users/dohertj2/.codex/worktrees/scada-ui-consistency/scadaproj/ZB.MOM.WW.Theme/tests/ZB.MOM.WW.Theme.Tests/bin/Release/net10.0/ZB.MOM.WW.Theme.Tests.dll +Test run for /Users/dohertj2/.codex/worktrees/scada-ui-consistency/scadaproj/ZB.MOM.WW.Theme/tests/ZB.MOM.WW.Theme.Tests/bin/Release/net10.0/ZB.MOM.WW.Theme.Tests.dll (.NETCoreApp,Version=v10.0) +A total of 1 test files matched the specified pattern. + +Passed! - Failed: 0, Passed: 16, Skipped: 0, Total: 16, Duration: 21 ms - ZB.MOM.WW.Theme.Tests.dll (net10.0) diff --git a/components/ui-theme/validation/theme-1.0.0/contrast-red.log b/components/ui-theme/validation/theme-1.0.0/contrast-red.log new file mode 100644 index 0000000..8282d04 --- /dev/null +++ b/components/ui-theme/validation/theme-1.0.0/contrast-red.log @@ -0,0 +1,138 @@ + Determining projects to restore... + All projects are up-to-date for restore. + ZB.MOM.WW.Theme -> /Users/dohertj2/.codex/worktrees/scada-ui-consistency/scadaproj/ZB.MOM.WW.Theme/src/ZB.MOM.WW.Theme/bin/Release/net10.0/ZB.MOM.WW.Theme.dll + ZB.MOM.WW.Theme.Tests -> /Users/dohertj2/.codex/worktrees/scada-ui-consistency/scadaproj/ZB.MOM.WW.Theme/tests/ZB.MOM.WW.Theme.Tests/bin/Release/net10.0/ZB.MOM.WW.Theme.Tests.dll +Test run for /Users/dohertj2/.codex/worktrees/scada-ui-consistency/scadaproj/ZB.MOM.WW.Theme/tests/ZB.MOM.WW.Theme.Tests/bin/Release/net10.0/ZB.MOM.WW.Theme.Tests.dll (.NETCoreApp,Version=v10.0) +A total of 1 test files matched the specified pattern. +[xUnit.net 00:00:00.07] ZB.MOM.WW.Theme.Tests.ThemeTokenContrastTests.Small_text_pairs_meet_AA(foreground: "--ok-ink", background: "--card") [FAIL] +[xUnit.net 00:00:00.08] ZB.MOM.WW.Theme.Tests.ThemeTokenContrastTests.Small_text_pairs_meet_AA(foreground: "--bad-ink", background: "--bad-bg") [FAIL] +[xUnit.net 00:00:00.08] ZB.MOM.WW.Theme.Tests.ThemeTokenContrastTests.Small_text_pairs_meet_AA(foreground: "--idle-ink", background: "--card") [FAIL] +[xUnit.net 00:00:00.08] ZB.MOM.WW.Theme.Tests.ThemeTokenContrastTests.Small_text_pairs_meet_AA(foreground: "--bad-ink", background: "--paper") [FAIL] +[xUnit.net 00:00:00.08] ZB.MOM.WW.Theme.Tests.ThemeTokenContrastTests.Small_text_pairs_meet_AA(foreground: "--ok-ink", background: "--ok-bg") [FAIL] +[xUnit.net 00:00:00.08] ZB.MOM.WW.Theme.Tests.ThemeTokenContrastTests.Small_text_pairs_meet_AA(foreground: "--warn-ink", background: "--paper") [FAIL] +[xUnit.net 00:00:00.08] ZB.MOM.WW.Theme.Tests.ThemeTokenContrastTests.Small_text_pairs_meet_AA(foreground: "--idle-ink", background: "--idle-bg") [FAIL] +[xUnit.net 00:00:00.08] ZB.MOM.WW.Theme.Tests.ThemeTokenContrastTests.Small_text_pairs_meet_AA(foreground: "--idle-ink", background: "--paper") [FAIL] +[xUnit.net 00:00:00.08] ZB.MOM.WW.Theme.Tests.ThemeTokenContrastTests.Small_text_pairs_meet_AA(foreground: "--ink-faint", background: "--card") [FAIL] + Failed ZB.MOM.WW.Theme.Tests.ThemeTokenContrastTests.Small_text_pairs_meet_AA(foreground: "--ok-ink", background: "--card") [1 ms] + Error Message: + Missing hex token --ok-ink + Stack Trace: + at ZB.MOM.WW.Theme.Tests.ThemeTokenContrastTests.Token(String name) in /Users/dohertj2/.codex/worktrees/scada-ui-consistency/scadaproj/ZB.MOM.WW.Theme/tests/ZB.MOM.WW.Theme.Tests/ThemeTokenContrastTests.cs:line 15 + at ZB.MOM.WW.Theme.Tests.ThemeTokenContrastTests.Small_text_pairs_meet_AA(String foreground, String background) in /Users/dohertj2/.codex/worktrees/scada-ui-consistency/scadaproj/ZB.MOM.WW.Theme/tests/ZB.MOM.WW.Theme.Tests/ThemeTokenContrastTests.cs:line 55 + at System.Reflection.MethodBaseInvoker.InterpretedInvoke_Method(Object obj, IntPtr* args) + at System.Reflection.MethodBaseInvoker.InvokeDirectByRefWithFewArgs(Object obj, Span`1 copyOfArgs, BindingFlags invokeAttr) + Failed ZB.MOM.WW.Theme.Tests.ThemeTokenContrastTests.Small_text_pairs_meet_AA(foreground: "--bad-ink", background: "--bad-bg") [< 1 ms] + Error Message: + Missing hex token --bad-ink + Stack Trace: + at ZB.MOM.WW.Theme.Tests.ThemeTokenContrastTests.Token(String name) in /Users/dohertj2/.codex/worktrees/scada-ui-consistency/scadaproj/ZB.MOM.WW.Theme/tests/ZB.MOM.WW.Theme.Tests/ThemeTokenContrastTests.cs:line 15 + at ZB.MOM.WW.Theme.Tests.ThemeTokenContrastTests.Small_text_pairs_meet_AA(String foreground, String background) in /Users/dohertj2/.codex/worktrees/scada-ui-consistency/scadaproj/ZB.MOM.WW.Theme/tests/ZB.MOM.WW.Theme.Tests/ThemeTokenContrastTests.cs:line 55 + at InvokeStub_ThemeTokenContrastTests.Small_text_pairs_meet_AA(Object, Span`1) + at System.Reflection.MethodBaseInvoker.InvokeWithFewArgs(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) + Failed ZB.MOM.WW.Theme.Tests.ThemeTokenContrastTests.Small_text_pairs_meet_AA(foreground: "--idle-ink", background: "--card") [< 1 ms] + Error Message: + Missing hex token --idle-ink + Stack Trace: + at ZB.MOM.WW.Theme.Tests.ThemeTokenContrastTests.Token(String name) in /Users/dohertj2/.codex/worktrees/scada-ui-consistency/scadaproj/ZB.MOM.WW.Theme/tests/ZB.MOM.WW.Theme.Tests/ThemeTokenContrastTests.cs:line 15 + at ZB.MOM.WW.Theme.Tests.ThemeTokenContrastTests.Small_text_pairs_meet_AA(String foreground, String background) in /Users/dohertj2/.codex/worktrees/scada-ui-consistency/scadaproj/ZB.MOM.WW.Theme/tests/ZB.MOM.WW.Theme.Tests/ThemeTokenContrastTests.cs:line 55 + at InvokeStub_ThemeTokenContrastTests.Small_text_pairs_meet_AA(Object, Span`1) + at System.Reflection.MethodBaseInvoker.InvokeWithFewArgs(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) + Failed ZB.MOM.WW.Theme.Tests.ThemeTokenContrastTests.Small_text_pairs_meet_AA(foreground: "--bad-ink", background: "--paper") [< 1 ms] + Error Message: + Missing hex token --bad-ink + Stack Trace: + at ZB.MOM.WW.Theme.Tests.ThemeTokenContrastTests.Token(String name) in /Users/dohertj2/.codex/worktrees/scada-ui-consistency/scadaproj/ZB.MOM.WW.Theme/tests/ZB.MOM.WW.Theme.Tests/ThemeTokenContrastTests.cs:line 15 + at ZB.MOM.WW.Theme.Tests.ThemeTokenContrastTests.Small_text_pairs_meet_AA(String foreground, String background) in /Users/dohertj2/.codex/worktrees/scada-ui-consistency/scadaproj/ZB.MOM.WW.Theme/tests/ZB.MOM.WW.Theme.Tests/ThemeTokenContrastTests.cs:line 55 + at InvokeStub_ThemeTokenContrastTests.Small_text_pairs_meet_AA(Object, Span`1) + at System.Reflection.MethodBaseInvoker.InvokeWithFewArgs(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) + Failed ZB.MOM.WW.Theme.Tests.ThemeTokenContrastTests.Small_text_pairs_meet_AA(foreground: "--ok-ink", background: "--ok-bg") [< 1 ms] + Error Message: + Missing hex token --ok-ink + Stack Trace: + at ZB.MOM.WW.Theme.Tests.ThemeTokenContrastTests.Token(String name) in /Users/dohertj2/.codex/worktrees/scada-ui-consistency/scadaproj/ZB.MOM.WW.Theme/tests/ZB.MOM.WW.Theme.Tests/ThemeTokenContrastTests.cs:line 15 + at ZB.MOM.WW.Theme.Tests.ThemeTokenContrastTests.Small_text_pairs_meet_AA(String foreground, String background) in /Users/dohertj2/.codex/worktrees/scada-ui-consistency/scadaproj/ZB.MOM.WW.Theme/tests/ZB.MOM.WW.Theme.Tests/ThemeTokenContrastTests.cs:line 55 + at InvokeStub_ThemeTokenContrastTests.Small_text_pairs_meet_AA(Object, Span`1) + at System.Reflection.MethodBaseInvoker.InvokeWithFewArgs(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) + Failed ZB.MOM.WW.Theme.Tests.ThemeTokenContrastTests.Small_text_pairs_meet_AA(foreground: "--warn-ink", background: "--paper") [< 1 ms] + Error Message: + --warn-ink on --paper: 3.79:1, requires 4.5:1 + Stack Trace: + at ZB.MOM.WW.Theme.Tests.ThemeTokenContrastTests.Small_text_pairs_meet_AA(String foreground, String background) in /Users/dohertj2/.codex/worktrees/scada-ui-consistency/scadaproj/ZB.MOM.WW.Theme/tests/ZB.MOM.WW.Theme.Tests/ThemeTokenContrastTests.cs:line 56 + at InvokeStub_ThemeTokenContrastTests.Small_text_pairs_meet_AA(Object, Span`1) + at System.Reflection.MethodBaseInvoker.InvokeWithFewArgs(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) + Failed ZB.MOM.WW.Theme.Tests.ThemeTokenContrastTests.Small_text_pairs_meet_AA(foreground: "--idle-ink", background: "--idle-bg") [< 1 ms] + Error Message: + Missing hex token --idle-ink + Stack Trace: + at ZB.MOM.WW.Theme.Tests.ThemeTokenContrastTests.Token(String name) in /Users/dohertj2/.codex/worktrees/scada-ui-consistency/scadaproj/ZB.MOM.WW.Theme/tests/ZB.MOM.WW.Theme.Tests/ThemeTokenContrastTests.cs:line 15 + at ZB.MOM.WW.Theme.Tests.ThemeTokenContrastTests.Small_text_pairs_meet_AA(String foreground, String background) in /Users/dohertj2/.codex/worktrees/scada-ui-consistency/scadaproj/ZB.MOM.WW.Theme/tests/ZB.MOM.WW.Theme.Tests/ThemeTokenContrastTests.cs:line 55 + at InvokeStub_ThemeTokenContrastTests.Small_text_pairs_meet_AA(Object, Span`1) + at System.Reflection.MethodBaseInvoker.InvokeWithFewArgs(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) + Failed ZB.MOM.WW.Theme.Tests.ThemeTokenContrastTests.Small_text_pairs_meet_AA(foreground: "--idle-ink", background: "--paper") [< 1 ms] + Error Message: + Missing hex token --idle-ink + Stack Trace: + at ZB.MOM.WW.Theme.Tests.ThemeTokenContrastTests.Token(String name) in /Users/dohertj2/.codex/worktrees/scada-ui-consistency/scadaproj/ZB.MOM.WW.Theme/tests/ZB.MOM.WW.Theme.Tests/ThemeTokenContrastTests.cs:line 15 + at ZB.MOM.WW.Theme.Tests.ThemeTokenContrastTests.Small_text_pairs_meet_AA(String foreground, String background) in /Users/dohertj2/.codex/worktrees/scada-ui-consistency/scadaproj/ZB.MOM.WW.Theme/tests/ZB.MOM.WW.Theme.Tests/ThemeTokenContrastTests.cs:line 55 + at InvokeStub_ThemeTokenContrastTests.Small_text_pairs_meet_AA(Object, Span`1) + at System.Reflection.MethodBaseInvoker.InvokeWithFewArgs(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) + Failed ZB.MOM.WW.Theme.Tests.ThemeTokenContrastTests.Small_text_pairs_meet_AA(foreground: "--ink-faint", background: "--card") [< 1 ms] + Error Message: + --ink-faint on --card: 3.21:1, requires 4.5:1 + Stack Trace: + at ZB.MOM.WW.Theme.Tests.ThemeTokenContrastTests.Small_text_pairs_meet_AA(String foreground, String background) in /Users/dohertj2/.codex/worktrees/scada-ui-consistency/scadaproj/ZB.MOM.WW.Theme/tests/ZB.MOM.WW.Theme.Tests/ThemeTokenContrastTests.cs:line 56 + at InvokeStub_ThemeTokenContrastTests.Small_text_pairs_meet_AA(Object, Span`1) + at System.Reflection.MethodBaseInvoker.InvokeWithFewArgs(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) +[xUnit.net 00:00:00.09] ZB.MOM.WW.Theme.Tests.ThemeTokenContrastTests.Small_text_pairs_meet_AA(foreground: "--warn-ink", background: "--card") [FAIL] +[xUnit.net 00:00:00.09] ZB.MOM.WW.Theme.Tests.ThemeTokenContrastTests.Small_text_pairs_meet_AA(foreground: "--bad-ink", background: "--card") [FAIL] +[xUnit.net 00:00:00.09] ZB.MOM.WW.Theme.Tests.ThemeTokenContrastTests.Small_text_pairs_meet_AA(foreground: "--ok-ink", background: "--paper") [FAIL] +[xUnit.net 00:00:00.09] ZB.MOM.WW.Theme.Tests.ThemeTokenContrastTests.Small_text_pairs_meet_AA(foreground: "--info-ink", background: "--info-bg") [FAIL] +[xUnit.net 00:00:00.09] ZB.MOM.WW.Theme.Tests.ThemeTokenContrastTests.Small_text_pairs_meet_AA(foreground: "--ink-faint", background: "--paper") [FAIL] +[xUnit.net 00:00:00.09] ZB.MOM.WW.Theme.Tests.ThemeTokenContrastTests.Small_text_pairs_meet_AA(foreground: "--warn-ink", background: "--warn-bg") [FAIL] + Failed ZB.MOM.WW.Theme.Tests.ThemeTokenContrastTests.Small_text_pairs_meet_AA(foreground: "--warn-ink", background: "--card") [< 1 ms] + Error Message: + --warn-ink on --card: 4.18:1, requires 4.5:1 + Stack Trace: + at ZB.MOM.WW.Theme.Tests.ThemeTokenContrastTests.Small_text_pairs_meet_AA(String foreground, String background) in /Users/dohertj2/.codex/worktrees/scada-ui-consistency/scadaproj/ZB.MOM.WW.Theme/tests/ZB.MOM.WW.Theme.Tests/ThemeTokenContrastTests.cs:line 56 + at InvokeStub_ThemeTokenContrastTests.Small_text_pairs_meet_AA(Object, Span`1) + at System.Reflection.MethodBaseInvoker.InvokeWithFewArgs(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) + Failed ZB.MOM.WW.Theme.Tests.ThemeTokenContrastTests.Small_text_pairs_meet_AA(foreground: "--bad-ink", background: "--card") [< 1 ms] + Error Message: + Missing hex token --bad-ink + Stack Trace: + at ZB.MOM.WW.Theme.Tests.ThemeTokenContrastTests.Token(String name) in /Users/dohertj2/.codex/worktrees/scada-ui-consistency/scadaproj/ZB.MOM.WW.Theme/tests/ZB.MOM.WW.Theme.Tests/ThemeTokenContrastTests.cs:line 15 + at ZB.MOM.WW.Theme.Tests.ThemeTokenContrastTests.Small_text_pairs_meet_AA(String foreground, String background) in /Users/dohertj2/.codex/worktrees/scada-ui-consistency/scadaproj/ZB.MOM.WW.Theme/tests/ZB.MOM.WW.Theme.Tests/ThemeTokenContrastTests.cs:line 55 + at InvokeStub_ThemeTokenContrastTests.Small_text_pairs_meet_AA(Object, Span`1) + at System.Reflection.MethodBaseInvoker.InvokeWithFewArgs(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) + Failed ZB.MOM.WW.Theme.Tests.ThemeTokenContrastTests.Small_text_pairs_meet_AA(foreground: "--ok-ink", background: "--paper") [< 1 ms] + Error Message: + Missing hex token --ok-ink + Stack Trace: + at ZB.MOM.WW.Theme.Tests.ThemeTokenContrastTests.Token(String name) in /Users/dohertj2/.codex/worktrees/scada-ui-consistency/scadaproj/ZB.MOM.WW.Theme/tests/ZB.MOM.WW.Theme.Tests/ThemeTokenContrastTests.cs:line 15 + at ZB.MOM.WW.Theme.Tests.ThemeTokenContrastTests.Small_text_pairs_meet_AA(String foreground, String background) in /Users/dohertj2/.codex/worktrees/scada-ui-consistency/scadaproj/ZB.MOM.WW.Theme/tests/ZB.MOM.WW.Theme.Tests/ThemeTokenContrastTests.cs:line 55 + at InvokeStub_ThemeTokenContrastTests.Small_text_pairs_meet_AA(Object, Span`1) + at System.Reflection.MethodBaseInvoker.InvokeWithFewArgs(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) + Failed ZB.MOM.WW.Theme.Tests.ThemeTokenContrastTests.Small_text_pairs_meet_AA(foreground: "--info-ink", background: "--info-bg") [< 1 ms] + Error Message: + Missing hex token --info-ink + Stack Trace: + at ZB.MOM.WW.Theme.Tests.ThemeTokenContrastTests.Token(String name) in /Users/dohertj2/.codex/worktrees/scada-ui-consistency/scadaproj/ZB.MOM.WW.Theme/tests/ZB.MOM.WW.Theme.Tests/ThemeTokenContrastTests.cs:line 15 + at ZB.MOM.WW.Theme.Tests.ThemeTokenContrastTests.Small_text_pairs_meet_AA(String foreground, String background) in /Users/dohertj2/.codex/worktrees/scada-ui-consistency/scadaproj/ZB.MOM.WW.Theme/tests/ZB.MOM.WW.Theme.Tests/ThemeTokenContrastTests.cs:line 55 + at InvokeStub_ThemeTokenContrastTests.Small_text_pairs_meet_AA(Object, Span`1) + at System.Reflection.MethodBaseInvoker.InvokeWithFewArgs(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) + Failed ZB.MOM.WW.Theme.Tests.ThemeTokenContrastTests.Small_text_pairs_meet_AA(foreground: "--ink-faint", background: "--paper") [< 1 ms] + Error Message: + --ink-faint on --paper: 2.92:1, requires 4.5:1 + Stack Trace: + at ZB.MOM.WW.Theme.Tests.ThemeTokenContrastTests.Small_text_pairs_meet_AA(String foreground, String background) in /Users/dohertj2/.codex/worktrees/scada-ui-consistency/scadaproj/ZB.MOM.WW.Theme/tests/ZB.MOM.WW.Theme.Tests/ThemeTokenContrastTests.cs:line 56 + at InvokeStub_ThemeTokenContrastTests.Small_text_pairs_meet_AA(Object, Span`1) + at System.Reflection.MethodBaseInvoker.InvokeWithFewArgs(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) + Failed ZB.MOM.WW.Theme.Tests.ThemeTokenContrastTests.Small_text_pairs_meet_AA(foreground: "--warn-ink", background: "--warn-bg") [< 1 ms] + Error Message: + --warn-ink on --warn-bg: 3.74:1, requires 4.5:1 + Stack Trace: + at ZB.MOM.WW.Theme.Tests.ThemeTokenContrastTests.Small_text_pairs_meet_AA(String foreground, String background) in /Users/dohertj2/.codex/worktrees/scada-ui-consistency/scadaproj/ZB.MOM.WW.Theme/tests/ZB.MOM.WW.Theme.Tests/ThemeTokenContrastTests.cs:line 56 + at InvokeStub_ThemeTokenContrastTests.Small_text_pairs_meet_AA(Object, Span`1) + at System.Reflection.MethodBaseInvoker.InvokeWithFewArgs(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) + +Failed! - Failed: 15, Passed: 1, Skipped: 0, Total: 16, Duration: 28 ms - ZB.MOM.WW.Theme.Tests.dll (net10.0) diff --git a/components/ui-theme/validation/theme-1.0.0/contrast.md b/components/ui-theme/validation/theme-1.0.0/contrast.md new file mode 100644 index 0000000..836e46f --- /dev/null +++ b/components/ui-theme/validation/theme-1.0.0/contrast.md @@ -0,0 +1,7 @@ +# TH-02 semantic text verification + +The new contrast suite first failed 15 cases and passed the black/white reference against the prior tokens. After semantic ink implementation, all 16 cases pass at the unchanged 4.5:1 threshold. Computed token ratios are recorded in `token-contrast.json`; matching state surfaces range from 5.55:1 to 7.99:1. Supporting text is 5.05:1 on paper and 5.56:1 on white. + +The full Theme suite at the integrated component source passes 101 tests, zero skips/failures (`tests/theme-components.trx`). This includes concurrent field/busy/shell regressions; raw before/red and green contrast logs remain attached. Signal values and dot backgrounds are unchanged. No hex literals were added outside the canonical token block. + +Actual consumer computed styles, alpha effects and visual acceptance remain pending local canaries; unit token math does not close those browser criteria. diff --git a/components/ui-theme/validation/theme-1.0.0/tests/theme-components.trx b/components/ui-theme/validation/theme-1.0.0/tests/theme-components.trx new file mode 100644 index 0000000..b97dee7 --- /dev/null +++ b/components/ui-theme/validation/theme-1.0.0/tests/theme-components.trx @@ -0,0 +1,634 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + [xUnit.net 00:00:00.00] xUnit.net VSTest Adapter v3.1.4+50e68bbb8b (64-bit .NET 10.0.14) +[xUnit.net 00:00:00.02] Discovering: ZB.MOM.WW.Theme.Tests +[xUnit.net 00:00:00.04] Discovered: ZB.MOM.WW.Theme.Tests +[xUnit.net 00:00:00.06] Starting: ZB.MOM.WW.Theme.Tests +[xUnit.net 00:00:00.26] Finished: ZB.MOM.WW.Theme.Tests + + + + \ No newline at end of file diff --git a/components/ui-theme/validation/theme-1.0.0/token-contrast.json b/components/ui-theme/validation/theme-1.0.0/token-contrast.json new file mode 100644 index 0000000..2d69a1f --- /dev/null +++ b/components/ui-theme/validation/theme-1.0.0/token-contrast.json @@ -0,0 +1,41 @@ +{ + "threshold": 4.5, + "pairs": [ + { + "foreground": "--ok-ink", + "background": "--ok-bg", + "ratio": 5.554998206317173 + }, + { + "foreground": "--warn-ink", + "background": "--warn-bg", + "ratio": 5.979044404341219 + }, + { + "foreground": "--bad-ink", + "background": "--bad-bg", + "ratio": 5.6903741760936315 + }, + { + "foreground": "--idle-ink", + "background": "--idle-bg", + "ratio": 5.881363117248676 + }, + { + "foreground": "--info-ink", + "background": "--info-bg", + "ratio": 7.990777005942016 + }, + { + "foreground": "--ink-faint", + "background": "--paper", + "ratio": 5.049654946674924 + }, + { + "foreground": "--ink-faint", + "background": "--card", + "ratio": 5.564484353037145 + } + ], + "browserAcceptance": "pending actual consumers; token math alone does not verify selector application" +}