UTS Phase 22.1 — Flutter token foundation (port the g-* system)
The load-bearing sub-phase — Flutter's "web Phase 1." Every later sub-phase (22.2–22.6) consumes these tokens; if the foundation is wrong, every surface reworks. Gated on nothing. Additive — the new
g-*token surface lands alongside the existingDesignTokens.guide*consts, which stay until each consuming widget migrates (deleted at 22.6). Soflutter analyzestays green and zero widgets change in 22.1.Provenance (why the mapping is authoritative, not invented): the existing Flutter guide tokens were themselves ported from the pre-UTS web —
design_tokens.dart:522/:814literally read "from kon_guide.css". So this sub-phase re-applies the web's ownkon_guide.css → kon_guide_v2.cssmigration (Phases 1–11, already shipped + live in prod) to the Flutter mirror. The old Flutter const = the old web rule; the newg-*const = the new web rule; the delta is the one the web already proved.Method (no guessing — per the program rule): the web
g-*system is my own shipped work; this sub-phase ports it, it does not re-derive it. Every value below is read from a source, withfile:line: - Values ←static/css/kon_guide_v2.css(the live, sole guide stylesheet —kon_guide.cssis retired). - Mapping target + app conventions ←flutter/gokonversed/lib/config/design_tokens.dart(old consts),theme.dart,site_config.dart,features/posts/ui/organisms/post_header_zone.dart(the on-brand pattern). - The specdesign-system-spec.md§1–§4 is the portable summary of the CSS; where they differ, the CSS wins.
Program: Under the Tuscan Sun → Phase 22. Owner: Flutter (with Travis).
Goal
Port the web's :root g-* design-system tokens (kon_guide_v2.css:15-40) into a new g* token surface in lib/config/design_tokens.dart, wiring the three brand-derived tokens through the conventions the production app already ships (no ThemeExtension, no new architecture). This is the tokens half of web Phase 1 (color semantics §2, two-tier typography §3, spacing/shape §4); the per-component exact values (§5A–F) are applied per surface in 22.2–22.6, read from kon_guide_v2.css at that point.
Scope
In: - The 17 :root g-* tokens (kon_guide_v2.css:15-40) → new DesignTokens members. - The brand-derived wiring: --g-brand (colorScheme.primary) and --g-brand-ink (lerp) — the 2 that can't be plain consts. (--g-on-brand is static Colors.white in prod — never overridden on the web; see the ledger.) - The two-tier typography weights (§3) and the shape tokens (radius/thumb/disc + the gallery tile size). - Delete the 1 dead white-label-leak const (guideLightboxCloseHoverColor, grep-verified 0 readers). (The 2nd leak, guideMaterialQuantityColor, has a live reader → its repoint to gInk defers to 22.3; see below.)
Out (→ later sub-phases / unchanged): - Per-component pixel values — material row padding, step title size, etc. (§5A–F) → applied in 22.2–22.6 from kon_guide_v2.css when each widget is restyled. - No widget edits in 22.1 (additive); no font work (BasicGothicPro already bundled, see Typography); no SiteConfig field add (D22.5: band = site brand + white, no per-post field needed); no ThemeExtension (D22.4). - Deleting the old DesignTokens.guide* consts — that's the 22.6 cleanup (the "kon_guide.css retirement" analog).
The token port — kon_guide_v2.css:15-40 → Flutter (the spine)
Add a // --- UTS g-* design system (port of kon_guide_v2.css :root) --- block to DesignTokens. Fixed values = static const; the 3 brand-derived = static helpers / the post pattern (below).
web token (kon_guide_v2.css) |
value | Flutter member |
|---|---|---|
--g-brand :17 |
var(--kon-brand-color, #cf0015) |
(not a const) Theme.of(context).colorScheme.primary — the per-site brand (= SiteConfig.primaryColorValue 0xFFCF0015). Read at the widget, as the app already does (43× primaryColor / 42× colorScheme.primary). |
--g-on-brand :24 |
#fff — never overridden in prod (the light-brand override is documented in the CSS comment :18-23 but not wired: base.gohtml:27 injects only --kon-brand-color) |
(not a const) Colors.white on every brand fill (band/disc/submit). Per-post header_text_color is the web's intended-but-unwired light-brand override → mirror only if/when the web wires it (D22.5). See Dynamic vs static. |
--g-brand-ink :25 |
color-mix(in srgb, brand 55%, --g-ink) |
(helper) DesignTokens.gBrandInk(brand) = Color.lerp(brand, gInk, 0.45)! — color-mix(brand 55%, ink) ≡ 0.45 toward ink (§7 sanctions Color.lerp as the color-mix equivalent). |
--g-ink :26 |
#222 |
static const Color gInk = Color(0xFF222222); |
--g-body :27 |
#3a3a3a |
gBody = Color(0xFF3A3A3A) |
--g-muted :28 |
#6b7280 |
gMuted = Color(0xFF6B7280) |
--g-faint :29 |
#9aa0a6 |
gFaint = Color(0xFF9AA0A6) |
--g-line :30 |
#eee |
gLine = Color(0xFFEEEEEE) |
--g-line2 :31 |
#e2e2e2 |
gLine2 = Color(0xFFE2E2E2) |
--g-tint :32 |
#f7f7f8 |
gTint = Color(0xFFF7F7F8) |
--g-ok :33 |
#198754 |
gOk = Color(0xFF198754) |
--g-bad :34 |
#dc3545 |
gBad = Color(0xFFDC3545) |
--g-warn-bg :35 |
#fff8e1 |
gWarnBg = Color(0xFFFFF8E1) (tip) |
--g-warn-bd :35 |
#f0c000 |
gWarnBd = Color(0xFFF0C000) |
--g-warn-ink :35 |
#7a5b00 |
gWarnInk = Color(0xFF7A5B00) |
--g-font :37 |
'BasicGothicWebPro',… |
SiteConfig.fontFamily ('BasicGothicPro' — already the app default; no token needed) |
--g-radius :39 |
6px |
gRadius = 6.0 |
--g-thumb :39 |
48px |
gThumb = 48.0 |
--g-disc :39 |
30px |
gDisc = 30.0 |
--g-shadow :40 |
0 10px 40px rgba(0,0,0,.18) |
gShadow = BoxShadow(offset: Offset(0,10), blurRadius: 40, color: Color(0x2E000000)) — overlay (lightbox) ONLY |