Repository navigation
feat(#138): normalize design tokens — add --color-placeholder, --border-radius, --transition-duration - #189
Merged
Merged
Conversation
…er-radius, --transition-duration
Add three component-level CSS custom properties to :root, replacing
previously hardcoded values with var() references. Defaults preserve
rendered output at the current 16px consumer root.
Tokens:
- --color-placeholder: #bdbfc4 (was hardcoded on ::placeholder)
- --border-radius: 4px (was hardcoded on .card, code/kbd,
inputs, buttons, and .grouped.gapless
outer corners; !important preserved)
- --transition-duration: 0.2s (was hardcoded on input/button
transitions)
9 hardcoded sites replaced across src/_base.css, src/_card.css,
src/_form.css. API manifest gains 3 customProperties (17 total,
185 selectors unchanged). New test/token-overrides.html fixture +
test/vrt/token-overrides.spec.js (Chromium, computed-style, no
screenshots) prove each token override propagates to every affected
surface. Docs (index.html #customizing, architecture.md) and
MIGRATION.md updated with defaults, before/after table, and override
example.
Size: gzip 3373 -> 3409 bytes (+36, within 4096 ceiling); baseline
updated with #138 rationale. VRT 101/101 green against existing
baselines (zero diffs — token substitutions value-preserving at
default :root). test:api 5/5, test:a11y 4/4, stylelint clean.
Closes #138.
jenil
force-pushed
the
work/138-design-tokens
branch
from
August 12, 2026 02:20
5a8b5b2 to
bc8a80f
Compare
jenil
marked this pull request as ready for review
August 12, 2026 02:24
jenil
added a commit
that referenced
this pull request
Aug 12, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #138.
Summary
Normalize three existing hardcoded design values into a small, documented custom-property API. Defaults preserve rendered output at the current 16px consumer root — this is a value-preserving change unless a consumer overrides the tokens.
Tokens added
--color-placeholder#bdbfc4::placeholdercolor (src/_form.css)--border-radius4pxborder-radius: 4pxon.card,code/kbd, inputs/select/textarea, buttons, and.grouped.gaplessfirst/last child outer corners--transition-duration0.2s0.2sin input/button transitions9 hardcoded sites replaced with
var()references acrosssrc/_base.css,src/_card.css,src/_form.css. The.grouped.gaplesscompound border-radius keeps!important; only the outer corners follow the token, inner0s stay literal (joined-border geometry).Hardcode inventory / ledger
--color-placeholdersrc/_form.css:241#bdbfc4::placeholder--border-radius(single)src/_base.css:152(code,kbd),src/_card.css:3(.card),src/_form.css:17(inputs),src/_form.css:48(buttons)4px--border-radius(compound,.grouped.gapless)src/_form.css:115,1194px(outer corners only).grouped.gapless > *:first/last-child!importantpreserved, inner0s stay literal--transition-durationsrc/_form.css:20,530.2s.button/buttonNo speculative tokens added (no warning/info/link/breakpoint/spacing/utility tokens). Out-of-scope candidates (e.g.
0.625rempaddings,2pxoutline width) were rejected as not genuine customization points.Changed files (13)
Source (3):
src/_base.css— 3 token declarations in:root;code,kbdborder-radius →var(--border-radius)src/_card.css—.cardborder-radius →var(--border-radius)src/_form.css— 6 replacements (2 border-radius, 2 transition-duration, 1 placeholder color, 2.grouped.gaplesscompound border-radius)Generated (2):
dist/chota.css,dist/chota.min.css— regenerated viayarn buildTests (3):
test/vrt/api-manifest.json— 3 newcustomProperties(17 total, 185 selectors unchanged)test/token-overrides.html(NEW) — minimal fixture with:rootoverride proving each token propagatestest/vrt/token-overrides.spec.js(NEW) — Chromium-pinned computed-style spec (no screenshots), port 3601Docs (3):
docs/index.html—#customizing:rootblock lists the 3 new tokensdocs/architecture.md— CSS Variables section adds--color-placeholder+ new "Component tokens" bullet; removed the stale "not exposed" noteMIGRATION.md— new "## Design Tokens" section with before/after table and override exampleConfig (2):
package.json—test:vrtscript appendstest/vrt/token-overrides.spec.js(additive only)baselines/size-baseline.json— gzip baseline 3373 → 3409 bytes (+36) with v1: normalize existing hardcoded design tokens #138 rationaleValidation evidence (local, macOS, Chromium)
yarn testyarn buildSize gate: 3409 bytes (baseline: 3409, ceiling: 4096)PASSyarn test:apiyarn test:vrtyarn test:a11ynpx playwright test test/vrt/token-overrides.spec.js --project=chromiumBase SHA:
22b2cd1(v1)Validation SHA:
5a8b5b2(work/138-design-tokens)Browser/OS/viewport: Chromium / macOS / 1280×720 (existing VRT also 375×667)
Size: gzip 3373 → 3409 bytes (+36, 687 bytes under 4096 ceiling)
Live browser verification
Loaded
test/token-overrides.htmlwith:root { --border-radius: 0px; --transition-duration: 0.5s; --color-placeholder: #ff0000; }and confirmed viagetComputedStyle:--border-radius: 0px.card0px(was4px)--border-radius: 0px.button0px(was4px)--transition-duration: 0.5s.button0.5s(was0.2s)--color-placeholder: #ff0000::placeholderrgb(255, 0, 0)(was#bdbfc4)--border-radius: 0px.grouped.gapless > *:first-child0px(was4px 0 0 4px)--border-radius: 0px.grouped.gapless > *:last-child0px(was0 4px 4px 0)Card Done checklist
bdbfc4only in:rootdefault)Notes for review
:rootdeclarations +var()references in place of literals. 687 bytes under the 4096 ceiling.breakpoints.spec.jsalready binds 3600)0px 0px 0px 0px→0px(Chromium CSSOM serializes four equal corners to a single value; consistent withcomponents.spec.js:208)Unresolved risk
Out of scope (per card)
No warning/info/link/breakpoint/spacing/utility tokens. No media-query runtime-configurability promise. No default dark palette. No changes to
.container,.row,.col-*,.tag, orbody.dark.