Skip to content

fix(core): checkbox and radio marks keep their share of the box a theme sizes - #12427

Closed
josephfarina wants to merge 4 commits into
mainfrom
core-indicator-marks-share-of-box
Closed

josephfarina wants to merge 4 commits into
mainfrom
core-indicator-marks-share-of-box

Conversation

@josephfarina

@josephfarina josephfarina commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

Record change: component:CheckboxIndicator gains FR8 and component:Indicator FR5 gains one sentence (the marks are a share of the box a theme sizes).
Picture check: the seven official themes, light and dark, with and without forced colors, render pixel-identical to main (28 of 28).

User impact

A theme can size the checkbox and radio boxes through the checkbox-indicator and radio-indicator targets (width, height), for example to draw small native-size 13px marks. Today the check (14px), the dash (12px) and the radio dot (10px) stay at fixed pixels, so in a smaller box the check is squeezed into the box's inside and fills it edge to edge, and the dot nearly fills the circle. With this change the marks are a share of the box: a 13px box draws a 7.6px check, a 6.5px dash and a 5px dot, in proportion and centered.

Problem and solution fit

  • Why does the defect occur? The box size and the mark sizes are separate fixed-pixel styles, so only the box follows a theme's size.
  • Why does it harm the task? Sizing the box is the only way a theme reaches the control's size, and doing it breaks the mark.
  • Why does that matter? A clipped check or a dot that hides the circle no longer reads as a checked control.

Expected behavior and authority

component:CheckboxIndicator FR8 (new) and component:Indicator FR5 (one sentence) record that the marks are a share of the box: check 12/20 at sm and 14/24 at md, dash width 1/2 (stroke stays 2px), dot 8/20 and 10/24. A percentage reads the box's content box, so the share is taken of the content box plus twice --border-width: the shipped 20px and 24px boxes draw exactly the shipped pixels, whatever border width a theme's token sets. When a theme sets the box's border width directly instead of through the token, the marks follow the token's width, so they grow or shrink by the share of that difference and stay centered (the box centers them with flex alignment). width and height on the two root targets stay best effort under architecture:component-theming-surface INV9, not guaranteed properties; no catalog change. A theme that sets the box's borderWidth directly gets marks slightly smaller or larger by that difference, as the changeset says.

Smallest restoration

  • CheckboxIndicator: check width/height and dash width as calc((100% + 2 * var(--border-width)) * share).
  • RadioIndicator: dot width/height the same way, rounded to whole pixels with round() behind @supports, so a browser without round() keeps the exact share: Chromium draws a dot of a fractional size as a rounded square despite its 50% radius.
  • No public API, prop, default, theming target or variable changes. Box sizes, the hidden input's hit area and the row layout are unchanged.

Evidence

  • Before: a theme with a 13px checkbox-indicator squeezes the 14px check into the 11px content box, edge to edge; a 13px radio-indicator draws a 10px dot in an 11px inside.
  • After, measured in Chromium on a theme that extends neutral with 13px boxes (light, dark, forced colors): every check, dash and dot sits inside the box's content box, centered to within 0.01px, at both sm and md; the dot is 5px, a whole circle. With a 2px border set directly on the circle, the dot is 7px or 9px, whole and centered.
  • Unchanged: the seven official themes (butter, chocolate, gothic, matcha, neutral, stone, y2k), light and dark, with and without forced colors, render unchecked, checked, indeterminate and disabled checkboxes and radios at sm and md, plus CheckboxInput and RadioList rows, pixel-identical to main (28 of 28 screenshots byte-identical).
  • Forced colors: the check and dash keep CanvasText and the dot stays visible, at shipped sizes and at 13px.
  • Regression test: marks.share-of-box.source-build.test.mjs compiles both indicators with the StyleX plugin and fails if a mark is left in fixed pixels, a share does not draw the shipped pixels at 20px or 24px, or a mark is wider than a 13px box's room at 0–2px borders. It fails on main (3 of 3) and passes here.
  • Rendered check: MarksFitTheBox.interaction.browser.spec.ts sizes the boxes as a theme does on the Indicator stories and measures every mark: shipped pixels at shipped sizes; inside a 13px box and centered; the dot a whole number of pixels, as tall as wide, also with a border set directly.

Writing rubric results

  • R1 narration: none; the added sentences state what the system does, in the present tense.
  • R2 research in the record: none.
  • R3 evidence naming a change: none; the new evidence row names its tests.
  • R4 rejected alternatives over one line or outside a decision: none.
  • R5 pull request or issue references remaining: none.
  • R6 ruled open questions still listing options: none.
  • R7 project status (build status or work order): none.

Scope

Components: Indicator (CheckboxIndicator, RadioIndicator)

  • One defect is restored.
  • Separable contradictory or unsettled tagalongs were removed or split.
  • No new public API, visual representation, default, or interaction model is hidden under the bug-fix label.
  • Public text and artifacts contain no internal Meta context.

Testing

  • vitest run packages/core/src/Indicator packages/core/src/CheckboxInput packages/core/src/RadioList packages/core/src/theme/themingTargets.test.ts: 13 files, 743 tests pass, the new file included.
  • pnpm check:knowledge: templates and records are aligned.
  • pnpm check:changesets, Prettier, ESLint and tsc --noEmit for Core pass; the five CLI type checks pass.

@vercel

vercel Bot commented Nov 17, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
astryx Ready Ready Preview Nov 18, 2026 8:36pm UTC

Request Review

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Meta Open Source bot. label Nov 17, 2026
@github-actions github-actions Bot added the needs:design-review Affects visuals — Design should review label Nov 17, 2026
@astracat-bot

astracat-bot Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

AI review status for this pull request.

Review status Updated
🟢 Reviewed (for maintainers only) Nov 18, 2026, 8:46 PM UTC

@github-actions github-actions Bot added the needs:spec-owner-review Current knowledge records await owner approval label Nov 17, 2026
@josephfarina
josephfarina marked this pull request as ready for review November 17, 2026 21:07
@github-actions

github-actions Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

PR Analysis Report

🔎 Preview · 6cb0372

Storybook · Sandbox · built from this PR's head

Modified components

Component Size LoC
Markdown 205.4 kB (+21 B) · 22.3 kB CSS (+164 B) —
RadioListItem 76.5 kB (+30 B) · 10.8 kB CSS (+141 B) —
DropdownMenuRadioItem 28.9 kB (+32 B) · 7.4 kB CSS (+133 B) —
26 more components
Component Size LoC
CheckboxListItem 80.5 kB (+36 B) · 12.2 kB CSS (+125 B) —
DropdownMenuCheckboxItem 28.8 kB (+27 B) · 7.4 kB CSS (+133 B) —
ListItem 79.6 kB (+33 B) · 12.2 kB CSS (+125 B) —
MultiSelector 103.3 kB (+26 B) · 18.0 kB CSS (+130 B) —
PowerSearch 310.6 kB (+34 B) · 25.7 kB CSS (+120 B) —
Pagination 147.8 kB (+25 B) · 19.2 kB CSS (+128 B) —
CheckboxInput 69.5 kB (+24 B) · 10.3 kB CSS (+128 B) —
Selector 114.9 kB (+18 B) · 18.8 kB CSS (+133 B) —
RadioIndicator 2.5 kB (+29 B) · 831 B CSS (+107 B) —
TableCell 104.6 kB (−1 B) · 19.4 kB CSS (+133 B) —
DropdownMenu 108.9 kB (0) · 19.1 kB CSS (+130 B) —
MoreMenu 109.2 kB (−1 B) · 19.1 kB CSS (+130 B) —
TableHeaderCell 104.4 kB (0) · 19.3 kB CSS (+129 B) —
ContextMenu 103.5 kB (+1 B) · 18.9 kB CSS (+127 B) —
Table 121.7 kB (0) · 20.0 kB CSS (+125 B) —
richtext/RichTextEditor 308.1 kB (+42 B) · 2.7 kB CSS (0) —
lab/CommentThread 372.4 kB (+35 B) · 2.4 kB CSS (0) —
lab/TransferListSelector 145.4 kB (+35 B) · 1.4 kB CSS (0) —
CheckboxIndicator 2.7 kB (−4 B) · 849 B CSS (+36 B) —
Tokenizer 106.0 kB (+2 B) · 20.4 kB CSS (+30 B) —
richtext/RichTextEditorToolbar 309.3 kB (+28 B) · 454 B CSS (0) —
lab/Comments 379.4 kB (+24 B) · 2.5 kB CSS (0) —
lab/TabBarMoreList 102.5 kB (+22 B) · 1.8 kB CSS (0) —
richtext/RichTextView 285.3 kB (+20 B) · 2.4 kB CSS (0) —
lab/TransferList 136.5 kB (+14 B) · 1.2 kB CSS (0) —
CheckIndicator 8.5 kB (0) · 681 B CSS (0) —

Package size: @astryxdesign/core 7.68 MB packed (+1.5 kB); no new dependencies.

Not run on this PR: add ci:run-visual for Visual, ci:run-a11y for Accessibility, ci:run-rtl for RTL.

Current run: CI concluded cancelled; parts of this report may be missing.


Generated by PR Enrichment workflow | View full report

@josephfarina

Copy link
Copy Markdown
Contributor Author

Owner decision (engineering owner, covering this pull request): the built-in checkbox and radio marks (check, dash and radio dot) are sized as a share of their indicator box, so a theme that resizes the box no longer clips the check or offsets the dot. At the shipped sizes the marks are pixel-identical. The CheckboxIndicator record (FR8) and the Indicator record (FR5) state this, with a picture sweep of the official themes, a shrunk-box test and a forced-colors check.

@josephfarina

Copy link
Copy Markdown
Contributor Author

/approve-spec bda3617

@github-actions github-actions Bot removed the needs:spec-owner-review Current knowledge records await owner approval label Nov 17, 2026
@josephfarina

Copy link
Copy Markdown
Contributor Author

Look check: the seven official themes draw identical pixels at both sizes, light and dark, with and without forced colors; a theme that sizes the boxes to 13px now draws fitted, centered marks, and no new problem appeared.

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes requested. The share-of-box sizing fits the check and dash to a theme-sized box and leaves the shipped sizes pixel-identical, but three things need fixing:

  • In RadioIndicator.tsx (lines 117-126), whenever the dot's share comes out fractional, as in a 13px circle or a circle whose borderWidth a theme sets directly like the Indicator docs' restyle example, Chromium draws the dot as a rounded square despite its 50% radius, so keep it circular (for example by snapping the share to whole pixels) and add a rendered check.
  • The changeset's "instead of a clipped 14px check" (and the description's matching "Before" line) misdescribes the base, where a 13px box shrinks the check to its 11px content box so it fills the box edge to edge rather than clipping, so please reword it.
  • The description says the new test "fails on main (2 of 3)", but it fails 3 of 3 there, and its "13 files, 743 tests" already include the new file, so please correct both counts.

Non-blocking: the changeset could mention that themes setting borderWidth on these targets directly now get slightly smaller marks at the shipped sizes, and FR8 should call box width and height best effort rather than a target-specific addition; the inline comments add two smaller points.

Claims and files checked

Review mode: full; reason: no-earlier-review

  • Changeset, marks sized as a share of their box: verified (CheckboxIndicator.tsx:142-162, RadioIndicator.tsx:117-126).
  • Changeset, a theme-sized box keeps fitting, centered marks: verified for size and centering; the dot's shape fails at fractional sizes.
  • Changeset, a 13px box draws a 7.6px check and a 5.4px dot: verified at md (7.8px and 5.2px at sm).
  • Changeset, instead of a clipped 14px check and a 10px dot: false for the check (it fills the 11px content box, not clipped); the 10px dot is right.
  • Changeset, shipped boxes draw the same pixels in every official theme: verified (no official theme sizes the box, its border or the border token; default stories render identically).
  • Description, marks were fixed pixels and a smaller box clips the check: fixed pixels verified; clipping false.
  • Description, the shares and the 2px dash stroke: verified.
  • Description, a directly set border makes the marks follow the token and stay centered: verified.
  • Description, no public API, prop, default, theming target or variable change: verified (the API surface is unchanged).
  • Description, box sizes, hit area and row layout unchanged: verified.
  • Description, after the change every mark sits inside the content box, centered within 0.01px: verified.
  • Description, forced colors keep the marks perceivable: verified (those rules are unchanged).
  • Description, the regression test fails on main 2 of 3: false (3 of 3).
  • Description, the listed test folders pass with 13 files and 743 tests plus the new file: the tests pass; the counts already include the new file.
  • Description, knowledge, changeset, ESLint and Core type checks pass: verified.
  • Description, Prettier passes: verified for the file types the repository checks; the new .mjs test is not formatted.
  • Description, CLI type checks pass: no CLI file changes.
  • .changeset/indicator-marks-share-of-box.md: finding (base behaviour).
  • docs/specs/components/Indicator/CheckboxIndicator.spec.md: note (FR8 wording).
  • docs/specs/components/Indicator/Indicator.spec.md: clear.
  • packages/core/src/Indicator/CheckboxIndicator.tsx: clear (comment wording note).
  • packages/core/src/Indicator/RadioIndicator.tsx: finding (dot shape).
  • packages/core/src/Indicator/marks.share-of-box.source-build.test.mjs: note (constant assertions, formatting).

Automated review (maintainer link)

Comment on lines +103 to +105
expect(20 * (12 / 20)).toBe(12);
expect(24 * (14 / 24)).toBe(14);
expect([20 / 2, 24 / 2]).toEqual([10, 12]);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Non-blocking: these three assertions are constant arithmetic and cannot fail; the set comparison on line 101 already pins the shares. Delete them, or compute the drawn size from the compiled values.

Comment on lines +137 to +141
// The marks keep their share of the box, so a theme that sizes the box
// (`checkbox-indicator` width and height) gets a mark that fits it. A
// percentage reads the box's content box, so the border is added back first:
// at the shipped 20px and 24px boxes the marks stay exactly 12px and 14px,
// whatever `--border-width` a theme sets.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Non-blocking (comment style): the second sentence is 35 words and passive, and "the marks stay exactly 12px and 14px" names only the check, since the dash is 10px and 12px. Suggested: "A theme can resize the box. The marks keep their share of it. A percentage reads the content box, so add the border back. The shipped boxes then draw the shipped marks." The same applies to RadioIndicator.tsx:112-116.

@github-actions github-actions Bot added the needs:spec-owner-review Current knowledge records await owner approval label Nov 17, 2026
@josephfarina

Copy link
Copy Markdown
Contributor Author

/approve-spec 5b96d7a

@github-actions github-actions Bot removed the needs:spec-owner-review Current knowledge records await owner approval label Nov 17, 2026

@astracat-bot astracat-bot Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes requested. The share-of-box sizing fits the check, dash and dot to a theme-sized box keeps the shipped 20px and 24px marks pixel-identical in Chromium, and the dot now stays a whole circle in current Chromium, but two things need fixing:

  • In RadioIndicator.tsx (lines 120-124), the rounded dot size and its fallback compile into one rule, and because the round() line contains var(--border-width), Chrome and Edge 114–124 (no round(), Tier 2 in the Browser Support guide) discard both and draw no dot at all, so under forced colors a checked radio looks unchecked; put the round() value behind @supports (width: round(1px, 1px)) and have the source-build test reject a round() length outside it.
  • The new MarksFitTheBox.interaction.browser.spec.ts fails CI's WebKit leg (line 86), which measures the shipped md check as 14 × 13.984375px against an exact toEqual([14, 14]), so compare within one layout unit (for example toBeCloseTo).

The earlier non-blocking notes on the comment wording (CheckboxIndicator.tsx:137-141, RadioIndicator.tsx:112-119) and the constant assertions in the source-build test (lines 106-108) still apply.

Claims and files checked

Review mode: full; reason: spec-record

Claims (changeset and description):

  • A 13px box draws a 7.6px check, a 6.5px dash and a 5px round dot, centered: verified in Chromium (7.58px, 6.5px, 5px, within 0.01px).
  • Before, the check was squeezed into the 11px inside, edge to edge, and the 10px dot nearly filled the circle: verified on the base (11px-wide check element, 10px dot).
  • The dot is rounded to whole pixels so it stays a circle: verified where round() exists; false in Chrome and Edge 114–124, where the dot is not drawn (RadioIndicator.tsx:120-124).
  • The dot falls back to the exact share where round() is missing: false; the fallback is discarded for the same reason.
  • The shipped 20px and 24px boxes draw the same pixels in every official theme: verified in Chromium for the default theme (byte-identical frames), and no official theme sets these targets' border or the border-width token; WebKit draws the md check 1/64px short.
  • A theme that sets borderWidth directly gets slightly different marks, still centered: verified (2px border: 12.8px check, 9px dot at md).
  • The shares are 12/20, 14/24, 1/2, 8/20 and 10/24 with a 2px dash stroke: verified in the source and compiled CSS.
  • No public API, prop, default, target or variable changes, and box sizes and hit areas are unchanged: verified (API surface: 0 rows).
  • Forced colors keep the check, dash and dot visible: verified in Chromium 125+; false for the dot in Chrome and Edge 114–124.
  • The source-build test fails on main (3 of 3) and passes here: verified.
  • The browser spec measures every mark on the Indicator stories: verified by reading; its shipped-size test fails in CI's WebKit leg.
  • 13 test files and 743 tests pass, the new file included: verified.
  • Knowledge, changeset, Prettier and ESLint checks pass: verified; the type checks were not run here.

Files:

  • .changeset/indicator-marks-share-of-box.md: clear.
  • docs/specs/components/Indicator/CheckboxIndicator.spec.md: clear.
  • docs/specs/components/Indicator/Indicator.spec.md: clear; its forced-colors sentence is what the dot defect breaks.
  • packages/core/src/Indicator/CheckboxIndicator.tsx: clear (non-blocking comment note).
  • packages/core/src/Indicator/RadioIndicator.tsx: blocking finding at lines 120-124.
  • packages/core/src/Indicator/__tests__/MarksFitTheBox.interaction.browser.spec.ts: blocking finding at line 86 (fails in CI's WebKit leg).
  • packages/core/src/Indicator/marks.share-of-box.source-build.test.mjs: non-blocking note at lines 106-108.

Automated review (maintainer link)

@josephfarina

Copy link
Copy Markdown
Contributor Author

/approve-spec 68aa0f2

@astracat-bot astracat-bot Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved pending CI: CI has not run on this head yet, because its admission step found CI full and cancelled the run, so the next step is to re-run all jobs. Both earlier blockers are fixed: the rounded radio dot now sits behind @supports, so a browser without round() keeps the exact-share dot, and the browser spec compares marks within a layout unit.

  • Optional: the source-build test (marks.share-of-box.source-build.test.mjs:126) passes whether or not the round() lengths sit inside the @supports block, so asserting the gate would catch a return to the earlier one-rule fallback.
  • Optional: the changeset's "The dot is rounded to whole pixels" could add "where the browser supports round()", as the record and the description say.
Claims and files checked

Review mode: incremental; reason: none

Claims (changeset and description):

  • The marks are a share of their box, so a theme-sized box gets proportionate marks: verified (a 13px box draws a 7.6px check at md, a 6.5px dash and a 5px dot, centered within 0.01px in Chromium).
  • Before, the 14px check was squeezed into the 11px inside, edge to edge, and the 10px dot nearly filled the circle: verified on the base (11 by 14px check element, 10px dot).
  • The dot is rounded to whole pixels so it stays a circle: verified where round() exists; in Chrome and Edge 114 to 124 a theme-sized box keeps the exact share (non-blocking wording note).
  • The shipped 20px and 24px boxes draw the same pixels in every official theme: verified in Chromium for the default theme by byte-identical frames, and for the others by unchanged built theme CSS and the share math (no official theme sizes these boxes or sets their border); WebKit lays the md check out 1/64px short of 14px.
  • A theme that sets the box's border width directly gets slightly smaller or larger marks, still centered: verified (2px border: 12.8px check and 9px dot at md).
  • The records gain the share rule (new checkbox FR8, the radio dot clause in FR5): verified.
  • The shares are 12/20 and 14/24 for the check, 1/2 for the dash with a 2px stroke, and 8/20 and 10/24 for the dot, of the content box plus twice the border token: verified in the source and the compiled CSS.
  • Box width and height stay best effort, with no catalog change: verified.
  • The dot's rounding sits behind @supports, so a browser without round() keeps the exact share: verified (separate rules in the compiled CSS; with the @supports rules removed, the shipped dots draw 8px and 10px and a 13px box draws 5.19px and 5.41px dots).
  • No public API, prop, default, target or variable changes, and box sizes, hit area and row layout are unchanged: verified (API surface 0 rows; theme CSS identical).
  • After the change, every mark sits inside the content box and centered at sm and md, the dot is 5px, and with a 2px border it is 7px or 9px: verified.
  • Forced colors keep the check, dash and dot visible: verified at 13px and at the shipped sizes, also with the round() rules removed.
  • The source-build test fails on main (3 of 3) and passes here: verified.
  • The browser spec measures the marks at the shipped sizes, in a 13px box and with a direct border: verified (6 of 6 in Chromium); its WebKit leg has not run, since CI did not run on this head.
  • The writing rubric finds no narration, research, status or references in the records: verified.
  • 13 test files and 743 tests pass: verified.
  • Knowledge, changeset, Prettier, ESLint and Core type checks pass: verified; the five CLI type checks were not run here.

Files:

  • .changeset/indicator-marks-share-of-box.md: clear (non-blocking wording note, line 5).
  • docs/specs/components/Indicator/CheckboxIndicator.spec.md: clear.
  • docs/specs/components/Indicator/Indicator.spec.md: clear.
  • packages/core/src/Indicator/CheckboxIndicator.tsx: clear (non-blocking comment note, lines 137-141).
  • packages/core/src/Indicator/RadioIndicator.tsx: clear; the earlier dot blocker is fixed (non-blocking comment note, lines 112-122).
  • packages/core/src/Indicator/__tests__/MarksFitTheBox.interaction.browser.spec.ts: clear; the earlier WebKit blocker is fixed in the source.
  • packages/core/src/Indicator/marks.share-of-box.source-build.test.mjs: clear (non-blocking notes, lines 106-108 and 126).

Automated review (maintainer link)

Comment on lines +112 to +122
// The dot keeps its share of the circle, so a theme that sizes the circle
// (`radio-indicator` width and height) gets a dot that stays centered inside
// it. A percentage reads the circle's content box, so the border is added back
// first: at the shipped 20px and 24px circles the dot stays exactly 8px and
// 10px, whatever `--border-width` a theme sets. Where the browser has
// `round()`, the share is rounded to whole pixels: Chromium draws a dot of a
// fractional size (a 13px circle, or a border set directly rather than through
// the token) as a rounded square despite its 50% radius. The rounded value
// sits behind `@supports`, so a browser without `round()` keeps the exact
// share instead of dropping the declaration (a value holding `var()` is only
// checked once the variable is substituted).

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Non-blocking (comment style): these four sentences run 27 to 41 words, with passive "is added back", "is rounded" and "is only checked". The reasons are worth keeping; shorter: "A theme can resize the circle. The dot keeps its share of it. A percentage reads the content box, so add the border back. Chromium draws a dot of a fractional size as a rounded square, so round it to whole pixels. A value with var() is valid only after substitution, so keep the rounded value behind @supports."

);
// Rounded to whole pixels where the browser can (a fractional dot draws
// as a rounded square), the exact share as the fallback.
expect(shares.filter(v => v.startsWith('round(')).length).toBe(4);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Non-blocking: this count passes whether or not the four round() lengths sit inside @supports (width: round(1px, 1px)), so the earlier one-rule fallback (which dropped the dot where round() is missing) passes it too, and both browser-spec projects have round(). Consider asserting that each round( length is inside that @supports block, beside a plain calc() rule for the same property.

'@astryxdesign/core': patch
---

[fix] The checkbox check and dash and the radio dot are sized as a share of their box, so a theme that sizes the box through the `checkbox-indicator` or `radio-indicator` target's `width` and `height` gets marks in proportion to it: a 13px box draws a 7.6px check and a 5px round dot, where before the 14px check was squeezed into the box's 11px inside, filling it edge to edge, and the 10px dot nearly filled the circle. The dot is rounded to whole pixels so it stays a circle. The shipped 20px and 24px boxes draw the same pixels as before in every official theme. A theme that sets the box's `borderWidth` directly, rather than through `--border-width`, gets marks slightly smaller or larger by that difference.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Non-blocking: "The dot is rounded to whole pixels so it stays a circle" holds where round() exists. In Chrome and Edge 114 to 124 a theme-sized box keeps the exact share (5.19px and 5.41px dots in a 13px circle). Consider "…rounded to whole pixels where the browser supports round()…", as FR5 and the description say.

…share-of-box

# Conflicts:
#	docs/specs/components/Indicator/Indicator.spec.md
@github-actions github-actions Bot added the needs:spec-owner-review Current knowledge records await owner approval label Nov 18, 2026
@josephfarina

Copy link
Copy Markdown
Contributor Author

/approve-spec 6cb0372

@github-actions github-actions Bot removed the needs:spec-owner-review Current knowledge records await owner approval label Nov 18, 2026

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved pending CI: CI has not run on this head yet, because its admission step found CI full and cancelled the run, so the next step is to re-run all jobs. The merge of main keeps the Indicator record's new FR7 unchanged, and the share-of-box sizing still draws the shipped marks pixel for pixel while fitting a theme-sized box. The earlier non-blocking notes (the untested @supports gate in the source-build test, comment length, and the changeset's round() qualifier) still stand on their threads.

Claims and files checked

Review mode: full; reason: spec-record

Claims (changeset and description):

  • The marks are a share of their box, so a theme-sized box gets proportionate marks (a 13px box draws a 7.6px check, a 6.5px dash and a 5px round dot): verified (7.58px check at md, 6.5px dash, 5px dot, centered within 0.01px in Chromium).
  • Before, the 14px check was squeezed into the 11px inside, edge to edge, and the 10px dot nearly filled the circle: verified on the base (an 11 by 14px check element at md, a 10px dot).
  • The dot is rounded to whole pixels so it stays a circle: verified where round() exists; without it a theme-sized box keeps the exact share (non-blocking wording note).
  • The shipped 20px and 24px boxes draw the same pixels in every official theme, light and dark, with and without forced colors: verified by byte-identical frames of the default theme in light and forced colors, unchanged built CSS for all seven themes, and no official theme sizing these boxes or setting their border.
  • A theme that sets the box's border width directly gets marks slightly smaller or larger, still centered: verified (a 2px border draws a 12.8px check and a 9px dot at md, centered).
  • The records gain the share rule (a new checkbox FR8 and the dot clause in the radio FR5): verified.
  • The shares are 12/20 and 14/24 for the check, 1/2 for the dash with a 2px stroke, and 8/20 and 10/24 for the dot, taken of the content box plus twice the border token: verified in the source and the compiled CSS.
  • Box width and height stay best effort, with no catalog change: verified (the Indicator docs are unchanged).
  • The dot's rounding sits behind @supports, so a browser without round() keeps the exact share, and Chromium draws a fractional dot as a rounded square: verified (separate rules in the compiled CSS; with them removed the shipped dots draw 8px and 10px, a 13px box draws 5.19px and 5.41px dots, and a 5.41px dot draws as a rounded square while a 5px one is round).
  • No public API, prop, default, target or variable changes, and box sizes, hit area and row layout are unchanged: verified (API surface 0 rows; only the mark rules change in the Core stylesheet).
  • After the change every mark sits inside the content box and centered at sm and md, in light, dark and forced colors, the dot is 5px, and with a 2px border it is 7px or 9px: verified.
  • Forced colors keep the check, dash and dot visible at the shipped sizes and at 13px: verified.
  • The source-build test fails on main (3 of 3) and passes here: verified.
  • The browser spec measures the marks at the shipped sizes, in a 13px box and with a direct border: verified (6 of 6 in Chromium); its WebKit leg has not run, since CI did not run on this head.
  • The writing rubric finds no narration, research, status or references in the records: verified.
  • 13 test files and 743 tests pass: verified.
  • Knowledge, changeset, Prettier, ESLint, Core and the five CLI type checks pass: verified.

Files:

  • .changeset/indicator-marks-share-of-box.md: clear (non-blocking wording note, line 5).
  • docs/specs/components/Indicator/CheckboxIndicator.spec.md: clear.
  • docs/specs/components/Indicator/Indicator.spec.md: clear; the merge keeps FR7 from main word for word.
  • packages/core/src/Indicator/CheckboxIndicator.tsx: clear (non-blocking comment note, lines 137-141).
  • packages/core/src/Indicator/RadioIndicator.tsx: clear (non-blocking comment note, lines 112-122).
  • packages/core/src/Indicator/__tests__/MarksFitTheBox.interaction.browser.spec.ts: clear.
  • packages/core/src/Indicator/marks.share-of-box.source-build.test.mjs: clear (non-blocking notes, lines 106-108 and 126).

Automated review (maintainer link)

josephfarina added a commit that referenced this pull request Nov 19, 2026
josephfarina added a commit that referenced this pull request Nov 19, 2026
josephfarina added a commit that referenced this pull request Nov 19, 2026
- #12680 perf(cli): a template's component line resolves its names in one pass, not one full lookup per name
  Author: Joey <[email protected]>
- #12180 fix(core): Calendar weekday names widen their column instead of overlapping
  Author: Joey <[email protected]>
- #12159 feat(cli): make an icon set inside your own app
  Author: Joey Farina <[email protected]>
- #12383 fix(Grid): a responsive column shrinks to a container narrower than minWidth
  Author: Joey Farina <[email protected]>
- #12374 [fix] Icon: a glyph given as name renders and warns, instead of crashing
  Author: Joey Farina <[email protected]>
- #12453 fix(charts): line, area and band default to straight segments
  Author: josephfarina <[email protected]>
- #12296 fix(core): a neutral Badge in a primary or destructive Button meets 4.5:1 on its fill
  Author: Joey Farina <[email protected]>
- #12395 fix(CodeBlock): without a code string, CodeBlock names the prop and the fix in development
  Author: Joey Farina <[email protected]>
- #12260 fix(cli): `astryx component Flex` names Stack first
  Author: Joey Farina <[email protected]>
- #12391 fix(core): a two-lane Toolbar wraps instead of squeezing its start lane
  Author: Joey Farina <[email protected]>
- #12427 fix(core): checkbox and radio marks keep their share of the box a theme sizes
  Author: josephfarina <[email protected]>
- #12725 [experimental] cli: with no icon set, experimental icon names the discover search where it lists packs
  Author: Joey Farina <[email protected]>
@josephfarina

Copy link
Copy Markdown
Contributor Author

Landed in #12738.

@github-actions
github-actions Bot deleted the core-indicator-marks-share-of-box branch November 19, 2026 06:05

This branch was successfully deployed

1 active deployment
Preview — 6cb0372b Deployed Nov 18, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Meta Open Source bot. needs:design-review Affects visuals — Design should review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant