Repository navigation
Conversation
…rem by 1.6
Chota previously set `html { font-size: 62.5% }`, which forced `1rem = 10px`
and overrode the consumer's root font-size, breaking accessibility zoom and
consumer overrides. This removes the override and divides every Chota-owned
rem value by 1.6 so rendered pixels are unchanged at a 16px consumer root.
Source changes (35 rem tokens across 6 files):
- src/_base.css: --grid-maxWidth 120rem->75rem, --grid-gutter 2rem->1.25rem,
--font-size 1.6rem->1rem; removed `font-size: 62.5%` from html; added a
source comment explaining Chota does not set the root font-size;
blockquote/hr/td,th/pre padding+margin converted.
- src/_card.css, src/_form.css, src/_nav.css, src/_tab.css, src/_tag.css:
padding/margin/width/height/letter-spacing rem tokens converted.
Untouched (no rem): src/_dropdown.css, src/_grid.css (uses var(--grid-gutter)),
src/_util.css, src/chota.css. All em/%/px/vh values unchanged — em-based
typography (h1-h6, .tag.is-small/large, .nav .brand, code/kbd) stays relative
to the body font-size, which remains 16px.
Documentation:
- MIGRATION.md: new "Root Font-Size Migration" section with what/why/consumer
impact/reference table/em-typography note.
- docs/index.html: updated the two Customizing code blocks (120rem->75rem,
2rem->1.25rem, 1.6rem->1rem, 108rem->67.5rem) and added a sentence stating
Chota does not set the root font-size.
Build + size gate:
- dist/chota.css and dist/chota.min.css regenerated.
- gzip size: 3372 -> 3373 bytes (+1 byte, from marginally longer decimal
tokens). Within the 4096-byte ceiling. baselines/size-baseline.json
updated with new gzip_bytes (3373), gzip_budget_remaining_bytes (723),
dist byte counts, and a #137 rationale entry.
Validation:
- yarn build: PASS (stylelint clean, postcss, size-gate 3373/3373/4096).
- yarn test:api: PASS (5/5, Chromium) — api-manifest.json records names only
and the names are unchanged; manifest not edited.
jenil
added a commit
that referenced
this pull request
Aug 9, 2026
…rem by 1.6 (#188) * feat(#137): migrate root font sizing — remove 62.5% override, divide rem by 1.6 Chota previously set `html { font-size: 62.5% }`, which forced `1rem = 10px` and overrode the consumer's root font-size, breaking accessibility zoom and consumer overrides. This removes the override and divides every Chota-owned rem value by 1.6 so rendered pixels are unchanged at a 16px consumer root. Source changes (35 rem tokens across 6 files): - src/_base.css: --grid-maxWidth 120rem->75rem, --grid-gutter 2rem->1.25rem, --font-size 1.6rem->1rem; removed `font-size: 62.5%` from html; added a source comment explaining Chota does not set the root font-size; blockquote/hr/td,th/pre padding+margin converted. - src/_card.css, src/_form.css, src/_nav.css, src/_tab.css, src/_tag.css: padding/margin/width/height/letter-spacing rem tokens converted. Untouched (no rem): src/_dropdown.css, src/_grid.css (uses var(--grid-gutter)), src/_util.css, src/chota.css. All em/%/px/vh values unchanged — em-based typography (h1-h6, .tag.is-small/large, .nav .brand, code/kbd) stays relative to the body font-size, which remains 16px. Documentation: - MIGRATION.md: new "Root Font-Size Migration" section with what/why/consumer impact/reference table/em-typography note. - docs/index.html: updated the two Customizing code blocks (120rem->75rem, 2rem->1.25rem, 1.6rem->1rem, 108rem->67.5rem) and added a sentence stating Chota does not set the root font-size. Build + size gate: - dist/chota.css and dist/chota.min.css regenerated. - gzip size: 3372 -> 3373 bytes (+1 byte, from marginally longer decimal tokens). Within the 4096-byte ceiling. baselines/size-baseline.json updated with new gzip_bytes (3373), gzip_budget_remaining_bytes (723), dist byte counts, and a #137 rationale entry. Validation: - yarn build: PASS (stylelint clean, postcss, size-gate 3373/3373/4096). - yarn test:api: PASS (5/5, Chromium) — api-manifest.json records names only and the names are unchanged; manifest not edited. * test(#137): add 10px/16px root-font scaling proof, update fixture/spec comments D3 test/fixture changes for card #137 (migrate root font sizing without visual regression). D2 already removed html { font-size: 62.5% } and divided all Chota rem tokens by 1.6 (commit f2c1102, PR #186). Tasks: - Convert inline .demo-label rem values in two validation fixtures (mobile-grid-overflow.html, nav-logo-full-height.html) by /1.6 to preserve rendered intent at a 16px consumer root. - Update stale spec comments in index.spec.js and components.spec.js to cite the new source rem values (1rem = 16px consumer root). Comments only — no expect() assertion values changed; rendered pixels at 16px root are unchanged. - Add test/vrt/root-font-scaling.spec.js: 3 computed-style tests proving (1) 16px root matches design intent, (2) 10px root scales every rem-derived property by 0.625, (3) the 10px/16px ratio is exactly 0.625 for pure-rem properties. No toMatchSnapshot (card forbids a second baseline). Not wired into test:vrt (shared package.json config requires owner approval). - Document the new spec in test/vrt/README.md. Evidence: - yarn build: no-op (dist size 3373 = baseline). - npx playwright test test/vrt/root-font-scaling.spec.js --project=chromium: 3 passed. - yarn test:a11y: 4 passed (axe-core rules unaffected by rem). - mobile-grid-overflow.spec.js: 4 passed. Known follow-up (out of scope for this card's Task 1 brief, reported to coordinator): nav-logo-full-height.spec.js has 10 screenshot baseline failures caused by fixture-authored inline style="min-height: 3rem/4rem/ 6rem" (13 occurrences) and one style="margin: 0 0.5rem" that were authored against the old 10px root and are not divided by 1.6. These are NOT Chota source tokens (D2's source migration is correct) and are NOT the .demo-label values converted here. Probe confirmed converting them makes all 15 nav-logo tests pass without baseline regeneration. Recommend a separate implementation card to convert those fixture-authored rem values. * test(#137): convert fixture-authored inline rem values in nav-logo-full-height.html (÷1.6) 14 inline style rem values (min-height: 3rem/4rem/6rem, margin: 0 0.5rem) were authored against the old 10px root scale. After D2's root-font migration they rendered at 1.6× their intended size, causing 10 nav-logo-full-height.spec.js screenshot baseline failures. Converting them by 1.6 preserves the rendered pixels at a 16px consumer root and restores yarn test:vrt to 100 passed. Coordinator scope correction: D3's brief limited this fixture edit to the .demo-label inline style; the full inline-rem conversion is necessary for VRT to be green and is part of the #137 root-font migration (same invariant).
Owner
Author
|
Closing — superseded by #188. This PR contained only the D2 (CSS source) half of #137. The complete change (D2 CSS + D3 tests/fixtures + the nav-logo-full-height.html inline-rem fixture conversions needed for VRT to pass) was merged as #188, which targets |
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.
Summary
Migrates Chota's root font sizing so it no longer sets
html { font-size: 62.5% }, removing the forced1rem = 10pxoverride that broke accessibility zoom and consumer root overrides. Every Chota-ownedremvalue is divided by 1.6 so rendered pixels are unchanged at a 16px consumer root.Closes #137.
What changed
Source (35 rem tokens across 6 files):
src/_base.css:--grid-maxWidth120rem→75rem,--grid-gutter2rem→1.25rem,--font-size1.6rem→1rem; removedfont-size: 62.5%fromhtml; added a source comment explaining Chota does not set the root font-size; convertedblockquote/hr/td,th/prepadding+margin.src/_card.css,src/_form.css,src/_nav.css,src/_tab.css,src/_tag.css: padding/margin/width/height/letter-spacing rem tokens converted.Untouched (no rem):
src/_dropdown.css,src/_grid.css(usesvar(--grid-gutter)),src/_util.css,src/chota.css. Allem/%/px/vhvalues unchanged — em-based typography (h1–h6,.tag.is-small/.is-large,.nav .brand,code/kbd) stays relative to the body font-size, which remains 16px.Documentation:
MIGRATION.md: new "Root Font-Size Migration" section (what/why/consumer impact/reference table/em-typography note).docs/index.html: updated the two Customizing code blocks and added a sentence stating Chota does not set the root font-size.Build:
dist/chota.cssanddist/chota.min.cssregenerated.baselines/size-baseline.jsonupdated:gzip_bytes3372→3373,gzip_budget_remaining_bytes724→723, dist byte counts, plus a v1: migrate root font sizing without visual regression #137 rationale entry.Consumer impact
--font-size: 1remat 16px root = 16px, same as old1.6remat 10px root = 16px).html { font-size: 62.5% }: Chota now renders at 0.625× its 16px-root size (proportional scaling, not a second baseline).--grid-maxWidth120rem75rem--grid-gutter2rem1.25rem--font-size1.6rem1remValidation
yarn build: PASS — stylelint clean, postcss, size-gate3373 bytes (baseline: 3373, ceiling: 4096) → PASS: Within baseline and ceiling.(exit 0)yarn test:api: PASS — 5/5 on Chromium (exit 0).api-manifest.jsonrecords names only and the names are unchanged; manifest not edited.grep "62.5%" dist/chota.css: empty (override removed).grep "0.625rem" dist/chota.css: matches present (conversion applied).git diff --check: clean (no whitespace errors).Size impact
dist/chota.cssbytesdist/chota.min.cssbytesThe +1 gzip byte comes from marginally longer decimal tokens (e.g.
0.625remvs1rem). Well within the 4096-byte ceiling; budget remaining: 723 bytes.Scope
v1@980c1f4work/137-root-fontf2c1102AGENTS.md,PLAN.md,test/AGENTS.md,playwright.config.js,package.json,.stylelintrc,postcss.config.js,test/vrt/api-manifest.json,test/vrt/*.spec.js,src/_dropdown.css,src/_grid.css,src/_util.css,src/chota.css.