fix(core): make Slider track color visible on muted backgrounds#3158
Merged
thedjpetersen merged 2 commits intoJun 27, 2026
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
🚀 Vercel Preview Deployment
|
Contributor
PR Analysis Report📚 Storybook PreviewView Storybook for this PR 🧪 Sandbox PreviewView Sandbox for this PR No new or modified components detected. Bundle Size Summary
Accessibility AuditStatus: No accessibility violations detected. Generated by PR Enrichment workflow | Storybook | Sandbox | View full report |
cixzhang
commented
Jun 26, 2026
| * Resolve the `background-color` value an element's classes map to in the | ||
| * injected StyleX stylesheet (returns the raw `var(--token)` reference). | ||
| */ | ||
| function resolveBackgroundColor(el: HTMLElement): string | undefined { |
Contributor
Author
There was a problem hiding this comment.
probably not necessary to have a behavior test for these visual ones. We will inspect it manually and evaluate the token usage.
thedjpetersen
approved these changes
Jun 27, 2026
The default background track used --color-background-muted, the same token as muted surface fills, so the track vanished on muted backgrounds. Switch it to the dedicated --color-track channel token, which is built to stay legible against body/muted surfaces. Also make the docsite Slider examples interactive: the showcase block now holds its own state via onChange, and the properties-tab preview gets an explicit width so the track has room to render and stays draggable. Closes #2876
9b6b456 to
16d2932
Compare
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.
The bug (#2876)
XDSSliderhad three issues:(not the fill) was painted with
--color-background-muted— the very tokenused for muted surface fills — so the track disappeared against muted
backgrounds.
static
value={50}with noonChange, so the thumb could not move.properties-tab preview had no defined width, leaving the track without room
to render or be dragged.
Reproduction (track color — part 1)
Added a unit test that resolves the rendered
.astryx-slider-trackelement'sStyleX class back to its injected
background-colorrule and asserts it usesthe visible channel token.
Root cause
styles.track.backgroundColorwas set tocolorVars['--color-background-muted'].That token is the muted surface fill, so a slim track painted with it has no
contrast against muted backgrounds. The design system already ships a dedicated
"channel on body" token,
--color-track(light-dark(#CCD3DB, #5A5E66)),explicitly intended for slider rails / progress tracks that must read against
body and muted surfaces.
The fix
backgroundColornow uses--color-track.onChangeso the slider is draggable.
playground.defaultsnow set an explicitwidth: 300so the track renders with room to drag and stays interactive.Closes #2876