fix(demo): repair broken interactive demos in docs/demo.html - #52
Conversation
- Transitions: add hover styles (background, shadow, transform) so the motion.css transition is actually visible - @Property color-pulse: bump lightness delta from +0.12 to +0.25 in core/motion.css so the pulse is perceptible at default saturation - Duration tokens: replace static <code> chips with hover-driven side-by- side comparison (5 rows, one per duration token) using the same easing - Ratio grids (.sf-grid-1-2 / 2-1 / 1-3 / 3-1): add container-type: inline-size on demo wrappers so the @container queries activate; add copy explaining why .sf-grid-1 stays single-column by design - .sf-grid-6 / .sf-grid--xs/s/m/l/xl: add note explaining responsive collapse, fix mismatched min sizes in labels (10/13rem) - .sf-imposter--contain: increase parent height 6rem → 12rem so content fits within (100% − 2 × --sf-imposter-margin) and overflow:auto stays inert - .sf-cluster: split misleading 'alignment' h3 into two clear sections, one for gap modifiers (--2xs / --xs / --l) with same-width items so the gap difference is visible, one for justify-content alignment - .sf-fade-out: split into a visible trigger button and a separate animated target so the demo is reachable after first play Co-authored-by: Jack Granatowski <contact@codeslash.net>
📝 WalkthroughWalkthroughThis PR tunes a color animation keyframe for greater visual intensity and comprehensively updates the design tokens demo page across three functional areas: Motion (transitions and duration tokens), Layout (grids and cluster gaps), and a fade-out animation example with trigger/target separation. ChangesMotion animations and demo enhancements
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 ESLint
ESLint skipped: no ESLint configuration detected in root package.json. To enable, add Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@docs/demo.html`:
- Around line 1204-1205: The button label text is inaccurate: change the text
"Slow spring (overridden inline)" inside the <button> that uses the class
.demo-transition-btn--spring to reflect that the override is class-based (for
example "Slow spring (overridden via class)"); update the inner text of the demo
button element that references .demo-transition-btn--spring to avoid saying
"inline".
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 062cef27-6cc3-46b5-a614-850f2bd9c400
⛔ Files ignored due to path filters (2)
dist/slashed.essential.cssis excluded by!**/dist/**dist/slashed.full.cssis excluded by!**/dist/**
📒 Files selected for processing (2)
core/motion.cssdocs/demo.html
| <button type="button" class="demo-transition-btn demo-transition-btn--spring"> | ||
| Slow spring (overridden inline) |
There was a problem hiding this comment.
Fix inaccurate demo label text.
Line 1205 says “overridden inline”, but the override is class-based (.demo-transition-btn--spring at Line 368+). Update the label to avoid misleading docs readers.
Suggested patch
- Slow spring (overridden inline)
+ Slow spring (class override)📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| <button type="button" class="demo-transition-btn demo-transition-btn--spring"> | |
| Slow spring (overridden inline) | |
| <button type="button" class="demo-transition-btn demo-transition-btn--spring"> | |
| Slow spring (class override) |
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@docs/demo.html` around lines 1204 - 1205, The button label text is
inaccurate: change the text "Slow spring (overridden inline)" inside the
<button> that uses the class .demo-transition-btn--spring to reflect that the
override is class-based (for example "Slow spring (overridden via class)");
update the inner text of the demo button element that references
.demo-transition-btn--spring to avoid saying "inline".
This pull request was created by @kiro-agent on behalf of @jackgranatowski 👻
Comment with /kiro fix to address specific feedback or /kiro all to address everything.
Learn about Kiro autonomous agent
Addresses the issues you reported in
/docs/demo.html. Each fix is surgical and targets the specific demo that misbehaved — no library API changes, just demo correctness and one tiny token tweak.What was wrong
transitionfrom motion.css but no actual style change between rest and:hover, so nothing to interpolate.sf-color-pulsel + 0.12— too subtle against saturated primary<code>chips.sf-grid-1/ Ratio grids.sf-grid-1-2/2-1/1-3/3-1are@container-driven; demo wrappers had nocontainer-type: inline-size. (.sf-grid-1is single-column by design — that part was correct, just unclear).sf-grid-6/.sf-grid--xs/s/m/l/xl.sf-grid-6needscontainer-type(already had it). Mostly a "no explanation" issue.sf-imposter--contain--sf-imposter-marginis fluid up to 2rem each side, leaving only ~2rem of usable height — content overflowed andoverflow:autoshowed a scrollbar.sf-cluster alignment: --xs / --2xs / --center / --end / --between--xs/--2xsare gap modifiers, the others are justify-content alignment.sf-fade-outanimation-fill-mode: both, so the button stayed atopacity: 0and was unreachableWhat I changed
docs/demo.html.demo-transition-btn/.demo-transition-btn--springwith explicit hover background/shadow/transform changes so the transition has something to interpolate.instant,fast,fast-as-default,normal,slow,slower). Each row shares the same easing — onlytransition-durationvaries, so users can compare speeds side by side. Rows aretabindex=0and respond to:focus-withinfor keyboard parity.container-type: inline-sizeto each.sf-grid-1-2/2-1/1-3/3-1wrapper; added prose explaining the breakpoint and that.sf-grid-1is single-column by design..sf-grid-6 / sf-grid--*: added explanatory paragraph; corrected min-size labels (--xs ~10rem,--s ~13remto matchtokens.layout.css)..sf-imposter--contain: bumped parent height6rem → 12remand clarified the contain rule in the label..sf-cluster: split into two h3s — gap modifiers (using uniform 3rem boxes so the gap difference is actually visible) and alignment (a clear default + 3 modifiers)..sf-fade-out: split into a visible "Play fade-out" trigger button (data-fade-out-trigger) and a separate target (data-fade-out-target) that gets the.sf-fade-outclass re-applied on each click. The trigger stays visible.core/motion.css@keyframes sf-color-pulse: lightness delta+0.12 → +0.25. Still tasteful, but actually perceptible at default saturation.dist/*What I did not change
You also flagged that layout primitives appear "doubled" — e.g.
Layout — Switcher(#layout-switcher) and the.sf-cluster--no-wrap / .sf-switcher--no-wrap / .sf-switcher--verticalh3 insideLayout — Additional Primitives(#layout-extra). Those sections aren't strict duplicates: the per-primitive sections show the basic primitive with its main modifier set;#layout-extracovers extra modifiers and combined primitives. But the navigation makes it read as duplication.This is a structural reorganization (folding
#layout-extrainto the per-primitive sections, or vice versa) and would touch a lot of selectors that the Playwright suite locks down via#layout-extrapaths. Happy to do it as a follow-up PR if you want — let me know which direction you prefer:#layout-extracontent into the per-primitive sections (one section per primitive, modifiers grouped under h3s).#layout-extrabut rename to "Modifiers & combinations" and tighten the per-primitive sections to introduction-only, with a clear cross-link.Verification notes
Playwright couldn't run in this sandbox (Chromium native deps unavailable here), but I verified by inspection that none of the existing test selectors (
#layout-extra .sf-cluster--center,#layout-extra .sf-grid-1-2, etc.) were renamed — only content additions and inlinecontainer-typeadditions, which strengthen the assertions in the existing tests.Summary by CodeRabbit
Style
Documentation