bgSurfaceCard exists in both port registries and not in the canonical DTCG #233
Labels
No labels
build-dist
priority
P1
priority
P2
priority
P3
priority
P4
bug
duplicate
enhancement
help wanted
invalid
question
wontfix
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
Toilville/toilville-design#233
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Split out from #231's decision comment, which records this as "a separate token and design-system gap" without filing one.
The gap, in #231's own words
So both ports ship a token the canonical source does not define. The ports agree with each other and disagree with the canon.
Why this is the awkward direction of drift
The usual drift is canon-ahead-of-code, which a sync catches. This is code-ahead-of-canon in both ports at once, which means:
apps/rituals-macos/tool/dtcg_to_udg_tokens.pygeneratesudg_tokens.jsonfrom the DTCG source. A token that exists only downstream of that generator is one the generator cannot produce or validate.What to decide
bgSurfaceCardbecome a canonical DTCG token, or do the ports stop using it in favour of an existing canonical surface token?#231 is explicit that this needs its own evidence, so this issue is the place to gather it rather than to assume an answer.
Acceptance
dart run tool/export_udg_tokens.dartregenerates cleanly and the committedapps/rituals-macos/Resources/udg_tokens.jsonmatches.Decision for #233:
bgSurfaceCardbecomes a canonical tokenThis is Ville's design decision.
Decision
bgSurfaceCardbecomes a canonical DTCG token, the semantic card-surface role. Its canonical path iscolor.bg.surface-card. Itsudg.dart-keystaysbgSurfaceCard, so no Flutter code changes name.Why
The system needs a card surface that separates a card from its surrounding surface without an outline. This supports the Rituals visual direction: fills, not decorative borders (#252). The canonical set has no such step today.
bg.surface-raisedis 1.09:1 from the page in light and 1.02:1 in dark.bg.surface-variantis 1.02:1 and 1.12:1. They are too close to the page to replace an outline.Not an alias of
bg.selectedbg.selectedreaches the same separation (1.51:1 light, 1.50:1 dark). It is still a different role. Card surface and selection are separate semantic states, and they can appear together. A selected card must show both. Aliasing them would remove that.Values
Rituals Light and Dark keep their existing card surface values. Vanilla Night may use
#333333for this role.textPrimaryon it#E2AC96#5F2E1C#333333The Rituals values are not a formula and not a rule for other themes.
For Vanilla Night,
#333333follows its current monochrome direction. It gives the card enough separation from the black page and adds no new colour. This is a decision about the card surface role only. It does not approve the rest of the Vanilla Night palette. The existingbg.surface-activealso uses#333333. That does not make card surface an alias ofbg.surface-active. They are two roles. They may share one raw value.What the audit found
Card,TextButton,OutlinedButtonandChip.bgSurfaceCardaccessor inUDGTokens.swiftand no use. It appears in the macOSudg_tokens.jsononly because the export path (tool/export_udg_tokens.dart) reads the Flutter registry and carries it downstream. The DTCG-to-JSON generator would not produce it.The other themes
The DTCG structure does not require a value in every theme. Only
lightis required. A theme without a value falls back to thelightvalue (extract.py,wcag.py). In the Rituals source, 37 of 64 colour tokens already have fewer than nine themes. The closest precedent is the surface family:bg.surface-raisedandbg.surface-varianteach definelight,darkandvanillanightonly.The palettes of the non-Rituals themes are work in progress. They have not been reviewed or approved as a whole. Nothing in #233 approves Accessible Alt, Cosmic Crisp, Pardner, Sundered, Truancy or Vanilla Day, or any relationship between their existing colours.
#233 makes no card surface decision for those six themes. Their card surface values will be decided when each theme is reviewed. A theme gains its own value then.
Until then, the
lightfallback must not make that decision by accident. If it did, those themes would silently inherit the Rituals Light terracotta (#E2AC96), and a Rituals-specific hue would become their card surface without any design review. So the decision needs a guard. The guard protects against an accidental design decision by fallback. It is not a permanent restriction on those themes. A theme leaves the guard when it gets its own value. The technical shape of the guard is an implementation question.Acceptance
color.bg.surface-cardis added to the Rituals DTCG source withlight,darkandvanillanightvalues,udg.css-varandudg.dart-key.lightfallback by accident. This covers the six themes above. A theme leaves the guard when it gets its own value.distartifacts regenerate cleanly (just build,just check).bgSurfaceCardleaves the app-authored maps intoken_registry.dart. The generated registry supplies it.dart run tool/export_udg_tokens.dartregeneratesapps/rituals-macos/Resources/udg_tokens.json. The committed file matches.text.primaryonbg.surface-cardpair is added to the contrast check. It covers the three themes that have a value.