Skip to content

fix(theme): the stock theme's dark-mode accent is darker, so white button text meets 4.5:1 - #9818

Merged
cixzhang merged 5 commits into
mainfrom
fix/accent-on-accent-contrast
Nov 4, 2026
Merged

cixzhang merged 5 commits into
mainfrom
fix/accent-on-accent-contrast

Conversation

@cixzhang

@cixzhang cixzhang commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor

User impact

In the stock theme's dark mode, every primary Button, and any other white label on an accent fill, is hard to read: white on #2694FE is 3.11:1, under the 4.5:1 that WCAG 1.4.3 asks for normal text. People with low vision, or anyone reading in bright light, can lose the most important action on the screen. After this change the dark accent is #0171E3, and the same label reads at 4.70:1.

Problem and solution fit

  • Why does it happen? The stock theme's dark-mode --color-accent is #2694FE, and --color-on-accent (the label on it) is white.
  • Why does it harm the task? A primary Button's label in dark mode reads at 3.11:1 at rest, and lower on hover (2.95:1) and press (2.80:1).
  • Why does that matter? architecture:theme-tokens now states the rule as INV12: the stock accent pair meets 4.5:1 in light and dark mode.

Fix: the stock theme's dark half of --color-accent changes from #2694FE to #0171E3. Light mode keeps #0064E0, and the --color-text-accent, --color-icon-accent and blue border tokens keep their dark values. Everything painted with --color-accent itself darkens in dark mode: accent fills, focus rings, and icons that use the accent.

Follow-through: three components painted text in --color-accent, so the darker fill colour would have pulled them under 4.5:1 in dark mode. They now read the text role, --color-text-accent, as text should (before → after):

  • MetadataList's "Show more": 3.50:1 → 5.86:1 on a dark card (it was 5.28:1 before this change).
  • Table's sort rank: the same pair.
  • DateRangeInput's applied preset: 2.32:1 → 3.88:1 on its muted fill on the popover (it was 3.49:1 before). It is still under 4.5:1, and DateRangeInput's record states that gap.

In light mode --color-text-accent equals --color-accent (#0064E0), so light mode doesn't change.

Contrast

Pair (dark mode) Before After
White label on the accent fill (rest) 3.11:1 4.70:1
White label on hover 2.95:1 4.35:1
White label on press 2.80:1 4.02:1
MetadataList "Show more" on a dark card (now --color-text-accent) 5.28:1 5.86:1
DateRangeInput applied preset on its muted fill (now --color-text-accent) 3.49:1 3.88:1
Accent fill against the dark page (#111112) 6.07:1 4.02:1 (3:1 needed for a non-text fill)

The rest values are exact for the token pair. The hover and press values come from the painted pixels of a primary Button in real Chrome. The hover and press overlays still leave the label under 4.5:1, and Button's record states that as an implementation gap.

Evidence

Real Chrome 156, the Core/Button/Primary and Core/ProgressBar/Default stories in dark mode with Core's own tokens (no first-party theme). Before: Storybook built from main. After: this branch.

Stock theme, dark mode: white label on the accent, before and after

  • contrast.test.ts "the stock accent pair meets 4.5:1 in the dark theme" was red on main (3.11:1). It is green here, and so is the light case.
  • expandColorScale.test.ts pins the default accent; its dark half moves to #0171E3. A theme that sets only a neutral style inherits the new dark accent, as it inherits every Core default.

Expected behavior and authority

  • architecture:theme-tokens INV12 (added here): "The stock accent pair meets 4.5:1: --color-on-accent on --color-accent meets 4.5:1 in light and dark mode in Core's defaults." Its verification row names the current values and the guard.
  • Button.spec.md Accessibility contract: "Implementation gap: Button's hover and pressed overlays on the dark accent give its label 4.35:1 and 4.02:1, under 4.5:1."
  • DateRangeInput.spec.md Accessibility contract: "Implementation gap: in dark mode the applied preset's label on its muted accent fill measures 3.88:1 on the popover surface, under 4.5:1."
  • To keep the previous look, a theme sets '--color-accent': ['#0064E0', '#2694FE']. The changeset says so too.

Smallest restoration

  • packages/core/src/theme/tokens.stylex.ts: the dark half of --color-accent.
  • packages/cli/assets/theme.template.ts: the theme template that astryx theme template writes had the same failing pair (#2694FE with a white on-accent). It now uses #0171E3.
  • packages/cli/assets/docs/tree/tokens-color.doc.mjs: regenerated with node scripts/generate-token-docs.mjs.
  • packages/core/api-report.md: the two lines that carry the accent's default value.
  • MetadataList.tsx, useTableSortable.tsx, DateRangeInput.tsx: text colour reads --color-text-accent.
  • contrast.test.ts: the stock-pair guard reads both halves through resolveThemeToken.
  • packages/native/.../DefaultTheme.swift: the generated Swift default theme's dark accent, so the Swift theme stays in step with Core.
  • Records as above; a patch changeset for @astryxdesign/core and @astryxdesign/cli.

The docs' light/dark tuple examples (theme.doc.mjs, use-a-theme.doc.mjs) only show the tuple syntax, so they keep their values.

Writing rubric results

Run over the architecture:theme-tokens, Button.spec.md and DateRangeInput.spec.md changes:

  • R1 narration: none; INV12 and the gap sentence state what the system does.
  • R2 research: none in the records; the contrast table and captures live in this description.
  • R3 evidence: the INV12 verification row cites the test and the current values, not a pull request.
  • R4 rejected alternatives: none added.
  • R5 change references: none.
  • R6 open questions: none added.

Scope

  • 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/theme packages/core/src/Button scripts/check-theme-template.test.mjs packages/cli/api/theme packages/cli/foundation/doc-compiler packages/themes: 2,580 passed; and vitest run packages/core/src/theme packages/core/src/MetadataList packages/core/src/Table/plugins/sortable packages/core/src/DateRangeInput packages/core/src/Button: 1,992 passed.
  • check-knowledge, check-changesets, changeset coverage, prettier: clean.

@vercel

vercel Bot commented Nov 3, 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 4, 2026 6:54pm UTC

Request Review

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Meta Open Source bot. label Nov 3, 2026
@astracat-bot

astracat-bot Bot commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor

AI review status for this pull request.

Review status Updated
🟢 Reviewed (for maintainers only) Nov 4, 2026, 7:02 PM UTC

--color-on-accent is the label on every --color-accent fill, such as a
primary Button's, so both halves of the stock pair must meet WCAG 1.4.3.
Red today: the dark half is white on #2694FE, 3.11:1.
@cixzhang
cixzhang force-pushed the fix/accent-on-accent-contrast branch from 618348a to 50b3fd7 Compare November 3, 2026 22:11
@github-actions

github-actions Bot commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor

PR Analysis Report

🔎 Preview · dd906cf

Storybook · Sandbox · built from this PR's head

Modified components

Component Size LoC Visual · A11y · RTL
lab/Comments 265.3 kB (+13 B) · 2.5 kB CSS (0) — — · — · —
MetadataList 16.7 kB (−1 B) · 3.8 kB CSS (+9 B) — — · — · —
DateRangeInput · Storybook 71.4 kB (+2 B) · 11.2 kB CSS (+3 B) 666 (0) — · — · —
194 more components
Component Size LoC Visual · A11y · RTL
LayerProvider 63.4 kB (+2 B) · 9.4 kB CSS (+3 B) — — · — · —
Markdown 146.1 kB (+2 B) · 18.8 kB CSS (+3 B) — — · — · —
MultiSelector 73.1 kB (+2 B) · 15.4 kB CSS (+3 B) — — · — · —
Tab 11.7 kB (0) · 4.2 kB CSS (+5 B) — — · — · —
Toast 59.7 kB (+2 B) · 9.0 kB CSS (+3 B) — — · — · —
AvatarGroup 37.5 kB (0) · 5.5 kB CSS (+4 B) — — · — · —
AvatarStatusDot 7.2 kB (0) · 3.6 kB CSS (+4 B) — — · — · —
Badge 4.0 kB (0) · 4.0 kB CSS (+4 B) — — · — · —
Blockquote 3.6 kB (0) · 3.5 kB CSS (+4 B) — — · — · —
BottomSheetSwitcher 17.2 kB (0) · 3.4 kB CSS (+4 B) — — · — · —
Breadcrumbs 16.0 kB (0) · 3.4 kB CSS (+4 B) — — · — · —
ButtonGroup 9.0 kB (0) · 3.4 kB CSS (+4 B) — — · — · —
ChatMessage 16.7 kB (0) · 3.7 kB CSS (+4 B) — — · — · —
ChatMessageBubble 7.1 kB (0) · 3.8 kB CSS (+4 B) — — · — · —
ClickableCard 15.0 kB (0) · 7.0 kB CSS (+4 B) — — · — · —
Code 3.6 kB (0) · 3.5 kB CSS (+4 B) — — · — · —
CommandPaletteFooter 17.0 kB (0) · 3.7 kB CSS (+4 B) — — · — · —
CommandPaletteGroup 3.5 kB (0) · 3.5 kB CSS (+4 B) — — · — · —
CommandPaletteItem 10.4 kB (0) · 3.6 kB CSS (+4 B) — — · — · —
DateInput 152.0 kB (+2 B) · 15.5 kB CSS (+2 B) — — · — · —
DropdownMenuGroup 6.2 kB (0) · 3.4 kB CSS (+4 B) — — · — · —
FieldLabel 38.0 kB (0) · 5.4 kB CSS (+4 B) — — · — · —
Grid 4.4 kB (0) · 3.8 kB CSS (+4 B) — — · — · —
Item 14.1 kB (0) · 5.2 kB CSS (+4 B) — — · — · —
Kbd 16.7 kB (0) · 3.6 kB CSS (+4 B) — — · — · —
NavHeadingMenu 15.3 kB (0) · 3.5 kB CSS (+4 B) — — · — · —
NavIcon 3.5 kB (0) · 3.4 kB CSS (+4 B) — — · — · —
Overlay 21.1 kB (+1 B) · 4.0 kB CSS (+3 B) — — · — · —
ResizeHandle 19.5 kB (0) · 4.3 kB CSS (+4 B) — — · — · —
SegmentedControlItem 10.7 kB (0) · 4.0 kB CSS (+4 B) — — · — · —
SideNavSection 6.6 kB (0) · 3.8 kB CSS (+4 B) — — · — · —
StatusDot 22.9 kB (0) · 5.2 kB CSS (+4 B) — — · — · —
Step 28.3 kB (0) · 5.6 kB CSS (+4 B) — — · — · —
TableBody 3.4 kB (0) · 3.3 kB CSS (+4 B) — — · — · —
TableFooter 3.4 kB (0) · 3.3 kB CSS (+4 B) — — · — · —
TableHeader 3.4 kB (0) · 3.3 kB CSS (+4 B) — — · — · —
TableRow 6.5 kB (0) · 4.0 kB CSS (+4 B) — — · — · —
Timer 9.5 kB (0) · 5.9 kB CSS (+4 B) — — · — · —
TopNav 56.0 kB (0) · 9.7 kB CSS (+4 B) — — · — · —
TreeList 39.4 kB (0) · 5.3 kB CSS (+4 B) — — · — · —
lab/CommentThread 260.0 kB (+4 B) · 2.4 kB CSS (0) — — · — · —
AlertDialog 86.8 kB (0) · 13.1 kB CSS (+3 B) — — · — · —
AppShell 73.3 kB (0) · 12.2 kB CSS (+3 B) — — · — · —
AspectRatio 3.8 kB (0) · 3.6 kB CSS (+3 B) — — · — · —
Avatar 34.8 kB (0) · 5.4 kB CSS (+3 B) — — · — · —
AvatarGroupOverflow 38.9 kB (0) · 5.5 kB CSS (+3 B) — — · — · —
Banner 47.3 kB (0) · 9.2 kB CSS (+3 B) — — · — · —
BaseTypeahead 55.4 kB (0) · 9.7 kB CSS (+3 B) — — · — · —
BreadcrumbItem 69.4 kB (0) · 11.3 kB CSS (+3 B) — — · — · —
Button 45.3 kB (0) · 8.7 kB CSS (+3 B) — — · — · —
Calendar 54.5 kB (0) · 9.3 kB CSS (+3 B) — — · — · —
Card 6.5 kB (0) · 6.4 kB CSS (+3 B) — — · — · —
Center 4.2 kB (0) · 4.6 kB CSS (+3 B) — — · — · —
ChatComposer 61.6 kB (0) · 10.6 kB CSS (+3 B) — — · — · —
ChatComposerDrawer 17.5 kB (0) · 4.7 kB CSS (+3 B) — — · — · —
ChatComposerInput 59.5 kB (0) · 10.0 kB CSS (+3 B) — — · — · —
ChatComposerTokenElement 59.5 kB (0) · 10.0 kB CSS (+3 B) — — · — · —
ChatDictationButton 45.9 kB (0) · 8.8 kB CSS (+3 B) — — · — · —
ChatLayout 48.5 kB (0) · 9.3 kB CSS (+3 B) — — · — · —
ChatLayoutScrollButton 45.8 kB (0) · 8.9 kB CSS (+3 B) — — · — · —
ChatMessageList 22.8 kB (0) · 6.9 kB CSS (+3 B) — — · — · —
ChatMessageMetadata 19.8 kB (0) · 4.2 kB CSS (+3 B) — — · — · —
ChatSystemMessage 6.8 kB (0) · 3.8 kB CSS (+3 B) — — · — · —
ChatTokenizedText 7.1 kB (0) · 4.0 kB CSS (+3 B) — — · — · —
ChatToolCalls 25.9 kB (0) · 8.2 kB CSS (+3 B) — — · — · —
CheckboxInput 48.7 kB (0) · 8.7 kB CSS (+3 B) — — · — · —
CheckboxListItem 54.1 kB (0) · 10.4 kB CSS (+3 B) — — · — · —
Citation 20.1 kB (0) · 4.5 kB CSS (+3 B) — — · — · —
CodeBlock 59.2 kB (0) · 10.0 kB CSS (+3 B) — — · — · —
Collapsible 23.4 kB (0) · 4.5 kB CSS (+3 B) — — · — · —
CollapsibleGroup 6.5 kB (0) · 3.3 kB CSS (+3 B) — — · — · —
CommandPaletteEmpty 6.2 kB (0) · 3.5 kB CSS (+3 B) — — · — · —
CommandPaletteInput 26.9 kB (0) · 7.4 kB CSS (+3 B) — — · — · —
CommandPaletteList 16.0 kB (0) · 3.4 kB CSS (+3 B) — — · — · —
ComplexSelector 55.8 kB (0) · 10.5 kB CSS (+3 B) — — · — · —
ContextMenu 75.4 kB (0) · 15.9 kB CSS (+3 B) — — · — · —
ContextMenuItem 20.9 kB (0) · 6.0 kB CSS (+3 B) — — · — · —
DialogHeader 48.2 kB (0) · 10.2 kB CSS (+3 B) — — · — · —
Drawer 40.5 kB (0) · 8.2 kB CSS (+3 B) — — · — · —
DrawerHeader 48.4 kB (0) · 11.6 kB CSS (+3 B) — — · — · —
DropdownMenu 74.1 kB (0) · 16.0 kB CSS (+3 B) — — · — · —
DropdownMenuCheckboxItem 19.2 kB (0) · 6.4 kB CSS (+3 B) — — · — · —
DropdownMenuItem 18.4 kB (0) · 6.0 kB CSS (+3 B) — — · — · —
DropdownMenuRadioGroup 6.1 kB (0) · 3.4 kB CSS (+3 B) — — · — · —
DropdownMenuRadioItem 19.2 kB (0) · 6.4 kB CSS (+3 B) — — · — · —
DropdownMenuSubMenu 57.9 kB (0) · 9.3 kB CSS (+3 B) — — · — · —
Field 41.9 kB (0) · 6.9 kB CSS (+3 B) — — · — · —
FieldStatus 9.6 kB (0) · 3.6 kB CSS (+3 B) — — · — · —
FileInput 53.8 kB (0) · 9.7 kB CSS (+3 B) — — · — · —
FormLayout 6.4 kB (0) · 3.5 kB CSS (+3 B) — — · — · —
GridSpan 3.5 kB (0) · 3.4 kB CSS (+3 B) — — · — · —
Heading 7.9 kB (0) · 4.9 kB CSS (+3 B) — — · — · —
HoverCard 19.3 kB (0) · 3.9 kB CSS (+3 B) — — · — · —
IconButton 45.4 kB (0) · 8.7 kB CSS (+3 B) — — · — · —
InfoTip 37.2 kB (0) · 5.0 kB CSS (+3 B) — — · — · —
InputGroup 43.0 kB (0) · 7.3 kB CSS (+3 B) — — · — · —
Lightbox 52.6 kB (0) · 9.1 kB CSS (+3 B) — — · — · —
Link 42.8 kB (0) · 6.9 kB CSS (+3 B) — — · — · —
ListItem 53.4 kB (0) · 10.4 kB CSS (+3 B) — — · — · —
MetadataListItem 6.6 kB (0) · 3.5 kB CSS (+3 B) — — · — · —
MobileNav 54.4 kB (0) · 9.3 kB CSS (+3 B) — — · — · —
MobileNavToggle 45.7 kB (0) · 8.7 kB CSS (+3 B) — — · — · —
MoreMenu 74.3 kB (0) · 16.0 kB CSS (+3 B) — — · — · —
NumberInput 55.1 kB (0) · 10.2 kB CSS (+3 B) — — · — · —
Outline 22.2 kB (0) · 4.2 kB CSS (+3 B) — — · — · —
OverflowList 8.6 kB (0) · 3.7 kB CSS (+3 B) — — · — · —
Pagination 87.9 kB (0) · 16.5 kB CSS (+3 B) — — · — · —
ProgressBar 10.8 kB (0) · 6.2 kB CSS (+3 B) — — · — · —
RadioList 43.4 kB (0) · 6.9 kB CSS (+3 B) — — · — · —
ScrollableArea 10.7 kB (0) · 4.3 kB CSS (+3 B) — — · — · —
Section 7.6 kB (0) · 6.3 kB CSS (+3 B) — — · — · —
SegmentedControl 82.9 kB (0) · 6.7 kB CSS (+3 B) — — · — · —
SelectableCard 15.2 kB (0) · 7.2 kB CSS (+3 B) — — · — · —
Selector 79.2 kB (0) · 16.2 kB CSS (+3 B) — — · — · —
SelectorOption 17.4 kB (0) · 5.8 kB CSS (+3 B) — — · — · —
SideNav 73.7 kB (0) · 10.1 kB CSS (+3 B) — — · — · —
SideNavHeading 59.9 kB (0) · 10.0 kB CSS (+3 B) — — · — · —
SideNavItem 54.9 kB (0) · 9.8 kB CSS (+3 B) — — · — · —
Skeleton 3.8 kB (0) · 3.8 kB CSS (+3 B) — — · — · —
Slider 91.0 kB (0) · 8.3 kB CSS (+3 B) — — · — · —
Spinner 18.5 kB (0) · 5.7 kB CSS (+3 B) — — · — · —
Stepper 46.9 kB (0) · 8.9 kB CSS (+3 B) — — · — · —
Switch 88.3 kB (0) · 9.5 kB CSS (+3 B) — — · — · —
TableCell 76.6 kB (0) · 16.4 kB CSS (+3 B) — — · — · —
TableHeaderCell 76.2 kB (0) · 16.1 kB CSS (+3 B) — — · — · —
TabList 35.5 kB (0) · 6.4 kB CSS (+3 B) — — · — · —
TabMenu 56.6 kB (0) · 9.9 kB CSS (+3 B) — — · — · —
Text 7.4 kB (0) · 4.9 kB CSS (+3 B) — — · — · —
TextArea 48.2 kB (0) · 8.8 kB CSS (+3 B) — — · — · —
TextInput 53.0 kB (0) · 9.9 kB CSS (+3 B) — — · — · —
Thumbnail 49.7 kB (0) · 10.3 kB CSS (+3 B) — — · — · —
TimeInput 138.2 kB (0) · 14.5 kB CSS (+3 B) — — · — · —
Timestamp 21.3 kB (0) · 8.9 kB CSS (+3 B) — — · — · —
ToggleButton 46.2 kB (0) · 8.8 kB CSS (+3 B) — — · — · —
ToggleButtonGroup 6.4 kB (0) · 3.4 kB CSS (+3 B) — — · — · —
Token 25.7 kB (0) · 4.8 kB CSS (+3 B) — — · — · —
Tokenizer 70.0 kB (0) · 17.2 kB CSS (+3 B) — — · — · —
Toolbar 34.8 kB (0) · 7.9 kB CSS (+3 B) — — · — · —
Tooltip 20.6 kB (0) · 3.9 kB CSS (+3 B) — — · — · —
TopNavHeading 59.3 kB (0) · 9.8 kB CSS (+3 B) — — · — · —
TopNavItem 11.0 kB (0) · 4.0 kB CSS (+3 B) — — · — · —
TopNavMegaMenu 54.4 kB (0) · 10.6 kB CSS (+3 B) — — · — · —
TopNavMegaMenuFeaturedCard 6.9 kB (0) · 3.6 kB CSS (+3 B) — — · — · —
TopNavMegaMenuItem 11.1 kB (0) · 4.2 kB CSS (+3 B) — — · — · —
TypeaheadItem 6.3 kB (0) · 3.6 kB CSS (+3 B) — — · — · —
charts/Chart 160.3 kB (+2 B) · 494 B CSS (0) — — · — · —
BottomSheet 55.1 kB (0) · 7.5 kB CSS (+2 B) — — · — · —
Carousel 49.7 kB (−1 B) · 9.5 kB CSS (+3 B) — — · — · —
ChatSendButton 45.8 kB (0) · 8.7 kB CSS (+2 B) — — · — · —
CheckboxList 44.6 kB (0) · 7.5 kB CSS (+2 B) — — · — · —
DateTimeInput 174.1 kB (−1 B) · 17.2 kB CSS (+3 B) — — · — · —
Dialog 21.3 kB (0) · 6.7 kB CSS (+2 B) — — · — · —
InputGroupText 6.4 kB (0) · 3.9 kB CSS (+2 B) — — · — · —
LayoutPanel 7.6 kB (0) · 4.9 kB CSS (+2 B) — — · — · —
Popover 52.1 kB (0) · 12.8 kB CSS (+2 B) — — · — · —
RadioListItem 51.9 kB (0) · 9.4 kB CSS (+2 B) — — · — · —
SideNavCollapseButton 46.2 kB (0) · 8.8 kB CSS (+2 B) — — · — · —
Table 84.8 kB (0) · 16.6 kB CSS (+2 B) — — · — · —
TableSelectionToolbar 54.9 kB (0) · 11.8 kB CSS (+2 B) — — · — · —
TopNavMenu 59.2 kB (0) · 9.9 kB CSS (+2 B) — — · — · —
Typeahead 63.2 kB (0) · 11.2 kB CSS (+2 B) — — · — · —
lab/TourStep 58.0 kB (+2 B) · 590 B CSS (0) — — · — · —
CommandPalette 53.5 kB (0) · 12.3 kB CSS (+1 B) — — · — · —
PowerSearch 244.8 kB (−2 B) · 22.2 kB CSS (+3 B) — — · — · —
lab/ChatReactionBar 66.5 kB (+1 B) · 1.1 kB CSS (0) — — · — · —
charts/ChartAxis 6.7 kB (0) · 112 B CSS (0) — — · — · —
charts/ChartLegend 34.4 kB (0) · 224 B CSS (0) — — · — · —
charts/ChartTooltip 136.9 kB (0) · 423 B CSS (0) — — · — · —
lab/ChartDotGL 7.4 kB (0) · 20 B CSS (0) — — · — · —
lab/ChartDotGLInteractive 8.3 kB (0) · 20 B CSS (0) — — · — · —
lab/ChartHeatmapGL 8.5 kB (0) · 20 B CSS (0) — — · — · —
lab/ChartStreamGL 7.5 kB (0) · 20 B CSS (0) — — · — · —
lab/ChatReasoning 7.0 kB (0) · 967 B CSS (0) — — · — · —
lab/ChatTypingIndicator 24.8 kB (0) · 612 B CSS (0) — — · — · —
lab/ChatUnreadDivider 3.6 kB (0) · 348 B CSS (0) — — · — · —
lab/CircularProgress 8.5 kB (0) · 1.1 kB CSS (0) — — · — · —
lab/CodeEditor 14.0 kB (0) · 743 B CSS (0) — — · — · —
lab/CommentComposer 104.9 kB (0) · 1.9 kB CSS (0) — — · — · —
lab/CommentPin 47.1 kB (0) · 1.2 kB CSS (0) — — · — · —
lab/DiffViewer 71.3 kB (0) · 2.1 kB CSS (0) — — · — · —
lab/EmojiPicker 70.8 kB (0) · 722 B CSS (0) — — · — · —
lab/LogStream 8.0 kB (0) · 1.6 kB CSS (0) — — · — · —
lab/Schedule 60.6 kB (0) · 3.9 kB CSS (0) — — · — · —
lab/SelectableCardGroup 50.4 kB (0) · 162 B CSS (0) — — · — · —
lab/Stat 4.2 kB (0) · 646 B CSS (0) — — · — · —
lab/SVGIcon 7.6 kB (0) · 764 B CSS (0) — — · — · —
lab/ThreeDScatterGL 7.6 kB (0) · 20 B CSS (0) — — · — · —
lab/TransferList 75.8 kB (0) · 1.7 kB CSS (0) — — · — · —
lab/TransferListSelector 83.4 kB (0) · 1.9 kB CSS (0) — — · — · —
richtext/RichTextEditor 278.4 kB (0) · 2.6 kB CSS (0) — — · — · —
richtext/RichTextEditorToolbar 228.7 kB (0) · 454 B CSS (0) — — · — · —
richtext/RichTextView 258.8 kB (0) · 2.3 kB CSS (0) — — · — · —
lab/ChatEmojiPicker 66.0 kB (−2 B) · 773 B CSS (0) — — · — · —
lab/ListInput 82.0 kB (−3 B) · 1.6 kB CSS (0) — — · — · —

Package size:

  • @astryxdesign/cli 3.35 MB packed (+2 B); no new dependencies
  • @astryxdesign/core 6.42 MB packed (+23 B); no new dependencies

API changes: core +0 · ~3 · −0

Committed API report behind this build: cli 8 rows, core 4 rows; run pnpm api:report.

3 API changes (advisory)
Package Where Signature Usage
~ core . · Values · const colorDefaults --color-accent: 'light-dark(#0064E0, #2694FE)' → --color-accent: 'light-dark(#0064E0, #0171E3)' import {colorDefaults} from '@astryxdesign/core'
~ core . · Values · const colorVars const colorVars: stylex.VarGroup<Readonly<{ readonly '--color-accent': "light-dark(#0064E0, #2694FE)"; readonly '--color-accent-muted': "light-dark(#0082FB33, #0082FB3F)"; reado … #a042f923 → const colorVars: stylex.VarGroup<Readonly<{ readonly '--color-accent': "light-dark(#0064E0, #0171E3)"; readonly '--color-accent-muted': "light-dark(#0082FB33, #0082FB3F)"; reado … #9de1262f import {colorVars} from '@astryxdesign/core'
~ core . · Values · const inputWrapperStyles const inputWrapperStyles: Readonly<{ readonly base: Readonly<{ readonly boxSizing: stylex.StyleXClassNameFor<"boxSizing", "border-box">; readonly position: stylex.StyleXClassNameFor<"pos … #90a96087 → const inputWrapperStyles: Readonly<{ readonly base: Readonly<{ readonly boxSizing: stylex.StyleXClassNameFor<"boxSizing", "border-box">; readonly position: stylex.StyleXClassNameFor<"pos … #ba795170 import {inputWrapperStyles} from '@astryxdesign/core'

Wide change (shared styles: packages/core/src/theme/contrast.test.ts, packages/core/src/theme/expandColorScale.test.ts, packages/core/src/theme/tokens.stylex.ts): add ci:run-visual, ci:run-a11y or ci:run-rtl to run them.


Generated by PR Enrichment workflow | View full report

@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.

Approval waits on an owner decision: the guard rightly holds the stock accent pair to 4.5:1 (WCAG 1.4.3, which spec:AST-020 assigns to component and theme), but no current record says which token changes to get there in dark mode.

What needs settling: whether the dark half of --color-on-accent becomes a dark ink, as the dark half of --color-on-error already is, or the dark half of --color-accent darkens. An engineering owner (the author can, as one) records that choice on this pull request; the token commit then lands with the record clause that states the value, and an engineering owner approves that head with /approve-spec <full head SHA>.

Required change:

  • Read the pair with resolveThemeToken(null, '--color-accent', {mode}) and resolveThemeToken(null, '--color-on-accent', {mode}) from tokens.ts, and delete halves() (contrast.test.ts:98-104), which duplicates that resolver and throws if the fix writes the dark half as a var() reference.

Also, the description's light ratio should read 5.39:1 (white on #0064E0, as the guard computes), not 4.82:1.

[Automated review]

Comment on lines +98 to +104
function halves(value: string): [light: string, dark: string] {
const match = /^light-dark\(\s*([^,]+?)\s*,\s*([^)]+?)\s*\)$/.exec(value);
if (match == null) {
return [value, value];
}
return [match[1], match[2]];
}

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.

resolveThemeToken in tokens.ts already resolves a token for one mode, following light-dark() and var(), and the repository's other contrast guard reads Core's defaults that way. This local regex returns the whole string when a half is a reference such as var(--color-text-primary), and contrastRatio then throws in both modes. Suggest dropping halves() and reading each half directly:

const accent = resolveThemeToken(null, '--color-accent', {mode});
const onAccent = resolveThemeToken(null, '--color-on-accent', {mode});

with mode set to 'light' or 'dark'. On today's values it gives the same 5.39:1 and 3.11:1.

…tton text meets 4.5:1

--color-accent's dark half is #0171E3 instead of #2694FE: white on it is
4.70:1 (was 3.11:1), so the stock accent guard passes. Light mode and the
dark text, icon and border accent tokens are unchanged. The CLI theme
template and the generated color token docs use the same value.

architecture:theme-tokens INV12 states the rule; Button's record notes the
hover and pressed overlays on the dark accent stay under 4.5:1.
@github-actions github-actions Bot added the needs:design-review Affects visuals — Design should review label Nov 4, 2026
@github-actions github-actions Bot added the needs:spec-owner-review Current knowledge records await owner approval label Nov 4, 2026
@cixzhang cixzhang changed the title fix(theme): the stock accent pair meets 4.5:1 in dark (guard first; token pending) fix(theme): the stock theme's dark-mode accent is darker, so white button text meets 4.5:1 Nov 4, 2026
@cixzhang

cixzhang commented Nov 4, 2026

Copy link
Copy Markdown
Contributor Author

/approve-spec c82622d

@github-actions github-actions Bot removed the needs:spec-owner-review Current knowledge records await owner approval label Nov 4, 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 darker stock dark accent (#0171E3, approved at this head with theme-tokens INV12) fixes the primary Button label (4.70:1, was 3.11:1), but four things need fixing first:

  • The darker accent pulls text that components paint in --color-accent under 4.5:1 in dark mode: MetadataList's "Show more" (MetadataList.tsx:161) drops from 5.28:1 to 3.50:1 on a dark card and Table's sort rank (useTableSortable.tsx:171) drops with it, so point those text styles at --color-text-accent.
  • halves() in contrast.test.ts re-implements the light-dark() parsing that resolveThemeToken already owns, so read the pair with resolveThemeToken(null, name, {mode}) and delete the helper.
  • The changeset says a primary Button's label meets 4.5:1 and that the dark accent text and icon colours are unchanged, but hovered and pressed labels stay near 4.36:1 and 4.03:1 and focus rings, accent icons and accent-coloured text darken, so reword it to match.
  • The changeset does not say how to keep the old look, which spec:AST-017 FR3 requires for a visual default change, so add that a theme can set '--color-accent': ['#0064E0', '#2694FE'].

DateRangeInput's selected preset was already under 4.5:1 and falls to 2.31:1; --color-text-accent alone lifts it only to 3.88:1, so it needs its own fix or a tracked gap. The description still calls the token commit pending and gives light mode as 4.82:1, which is 5.39:1.

[Automated review]

export const colorDefaults = {
// Core semantic
'--color-accent': 'light-dark(#0064E0, #2694FE)',
'--color-accent': 'light-dark(#0064E0, #0171E3)',

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.

In dark mode this also darkens text that components paint in --color-accent: MetadataList's "Show more" (MetadataList.tsx:161) drops from 5.28:1 to 3.50:1 on a dark card, and Table's sort rank (useTableSortable.tsx:171) drops with it. Pointing those text styles at --color-text-accent (dark #3E9EFB, 5.86:1 on a card) keeps them readable.

'@astryxdesign/cli': patch
---

[fix] The stock theme's dark-mode accent (`--color-accent`) is now `#0171E3` instead of `#2694FE`, so white text on an accent fill, such as a primary Button's label, meets 4.5:1 (4.70:1, was 3.11:1). Light mode keeps `#0064E0`, and the dark text, icon and border accent colors are unchanged. The theme template that `astryx theme template` writes uses the same dark accent, and the generated color token docs list it.

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.

Two fixes here. The label meets 4.5:1 at rest only (about 4.36:1 hovered and 4.03:1 pressed, as the Button record notes), and focus rings, accent icons and accent-coloured text do darken in dark mode. Also add the way back to the old look: a theme can set '--color-accent': ['#0064E0', '#2694FE'].

…ard reads Core's resolver

MetadataList's Show more, Table's sort rank and DateRangeInput's applied
preset painted text in --color-accent, so the darker dark accent pulled them
under 4.5:1. They now read --color-text-accent. DateRangeInput's preset still
measures 3.88:1 on its muted fill in dark mode; its record notes the gap.

The stock-pair guard reads both halves through resolveThemeToken instead of
parsing light-dark() itself. The changeset names what darkens, the hover and
press levels, and how a theme keeps the previous accent.
@github-actions github-actions Bot added the needs:spec-owner-review Current knowledge records await owner approval label Nov 4, 2026
@cixzhang

cixzhang commented Nov 4, 2026

Copy link
Copy Markdown
Contributor Author

/approve-spec fac8e73

@github-actions github-actions Bot removed the needs:spec-owner-review Current knowledge records await owner approval label Nov 4, 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 a draft runs no CI; marking the pull request ready for review starts it.

The darker stock dark accent (#0171E3) lifts a primary Button's white label from 3.11:1 to 4.70:1, theme-tokens INV12 and the two implementation-gap notes carry an engineering owner's approval at this head, and the new guard fails on the base and passes here. The changes requested on the previous revision are all in: accent-coloured text now reads --color-text-accent (5.86:1 on a dark card), the guard reads through resolveThemeToken, and the changeset gives the hover and press levels and how to keep the old look.

[Automated review]

@cixzhang
cixzhang marked this pull request as ready for review November 4, 2026 18:23
@cixzhang
cixzhang marked this pull request as draft November 4, 2026 18:39
@cixzhang

cixzhang commented Nov 4, 2026

Copy link
Copy Markdown
Contributor Author

/approve-spec dd906cf

@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 a draft runs no CI; marking the pull request ready for review starts it.

The darker stock dark accent (#0171E3) lifts a primary Button's white label from 3.11:1 to 4.70:1, theme-tokens INV12 and the two implementation-gap notes carry an engineering owner's approval for this head, and accent-coloured text now reads --color-text-accent (5.86:1 on a dark card). The regenerated Swift default theme matches Core's new dark accent, so its drift test passes.

[Automated review]

@cixzhang
cixzhang marked this pull request as ready for review November 4, 2026 19:25
@cixzhang
cixzhang merged commit 504ee18 into main Nov 4, 2026
111 checks passed
@astracat-bot astracat-bot Bot mentioned this pull request Nov 4, 2026
3 tasks done
@github-actions
github-actions Bot deleted the fix/accent-on-accent-contrast branch November 5, 2026 06:03
vjeux added a commit to vjeux/astryx that referenced this pull request Nov 5, 2026
Only packages/core/api-report.md changes, as pnpm api:report writes it on
main bfc1dcc: useClickableContainer's parameter spelling (meta#8085), the
colorVars and inputWrapperStyles hashes after the dark-mode accent change
(meta#9818), and the array spelling of visibleCalendarMonths (meta#10007).
cixzhang pushed a commit that referenced this pull request Nov 6, 2026
…le (#10056)

chore: regenerate the four core API report rows three merges left stale

Only packages/core/api-report.md changes, as pnpm api:report writes it on
main bfc1dcc: useClickableContainer's parameter spelling (#8085), the
colorVars and inputWrapperStyles hashes after the dark-mode accent change
(#9818), and the array spelling of visibleCalendarMonths (#10007).

This branch was successfully deployed

1 active deployment
Preview — dd906cfe Deployed Nov 4, 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