Repository navigation
fix(docs): restyle the preview controls to match the site - #3
leoisadev1 merged 1 commit into
Conversation
The controls tray under each example used a black selected segment, the browser's default range input, a switch whose thumb turned black, and an off-centre ring on colour swatches. Segments now sit in a pill track with a sliding chip like the Preview/Code tabs, sliders use Radix with a thumb and fill that glide between values, the switch thumb stays white, and the swatch ring is drawn concentric in the swatch's colour. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
DCN-43 Restyle the preview controls to match the docs
ProblemThe controls tray under each example uses styling that doesn't match the rest of the docs. The selected segment is a black block cut into the card, the sliders are the browser's default range input, and the switch thumb turns black when on. GoalThe segmented options, sliders, switch, and colour swatches read as part of the same site as the nav and the Preview/Code tabs. Acceptance criteria
How to verifyOpen /docs/backgrounds/aurora, change each control, and compare against the nav and tabs in both themes. |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
[Medium impact] The PR appears safe to merge; no actionable issues were found. SummaryRestyles the docs preview controls with a sliding selection chip, Radix sliders, white switch thumbs, and centered color-swatch rings.
Reviews (1) · Last reviewed commit: "Restyle the preview controls to match th..." · Reviewed by Greptile |
Summary
The controls tray under each example didn't look like the rest of the docs: the selected segment was a black block cut into the card, sliders were the browser's default range input, the switch thumb turned black when on, and the ring on the selected colour swatch sat off-centre. This restyles all four in
components/preview-controls.tsxso they read like the nav and the Preview/Code tabs.Evidence
Checked on
/docs/backgrounds/aurorawith agent-browser in Chrome, at 1440px and 390px, dark and light:After: the chip lands on the chosen option (0px offset measured in all three groups); thumb centre and fill edge stay within 1px of each other on every frame of the glide; mouse drag, arrow keys, and Tab all change values.
min === maxrenders disabled instead of NaN positions; scale effects respect reduced motion.ultracite checkandtsc --noEmitpass.Not tested: Firefox, and right-to-left layouts for the Radix slider (the site has no RTL pages).
Merge Danger
Door: two-way. Styling and one docs-only component; reverting the commit restores the old controls.
Blast radius: the controls tray on every example page in the docs. The demos only read values through
usePreviewValue, which is unchanged.Fixes DCN-43
Created with Claude Opus 5.5 in Claude Code.