Add raw CSS value input mode to SliderRow component - #447
Conversation
- SliderRow now accepts rawDefault + onRawSet props; shows actual framework default (e.g. "default: var(--sf-space-m)") below the slider and exposes a </> toggle to switch to a free-text raw input that accepts any CSS value including var()/calc() expressions. Auto-switches to raw mode when the current override is a CSS function. - SpacingPanel: --sf-gap, --sf-content-gap, --sf-gutter now show their real defaults (var(--sf-space-m/s/l)) instead of hardcoded rem values. - LayoutPanel: --sf-center-gutter, --sf-imposter-margin, --sf-alternate-inner-gap, --sf-sticky-offset-mobile/desktop, --sf-center-max, --sf-content-width, --sf-breakout-width all wired with rawDefault so their CSS var relationships are visible. - BordersPanel: fix radius step defaults (m: 6→8px, l: 10→12px, xl: 14→16px, 2xl: 20→24px to match calc(Npx * var(--sf-radius-scale))); fix button token names --sf-button-* → --sf-btn-* to match the framework's optional/tokens.components.css; add rawDefault for all component shape, divider-gap, and divider-width tokens. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011GgFN1mxJWjgGdwV6WGj2B
PR Summary by QodoSliderRow: add raw CSS input mode for token overrides Description
Diagram
High-Level Assessment
Files changed (5)
|
|
Warning Review limit reached
Next review available in: 16 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (5)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Code Review by Qodo
Context used✅ Compliance rules (platform):
6 rules 1.
|
Introduced a local rawDraft state and isEditing flag so the text field keeps its value during incremental typing. External currentRaw changes sync back to rawDraft only when the field is not focused, preventing Svelte re-renders from blanking the input mid-edit. Also loosened the label prop type to optional (label?: string) to match the existing template guard. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011GgFN1mxJWjgGdwV6WGj2B
Summary
Extends the
SliderRowcomponent to support direct CSS expression input (variables, calc, clamp, etc.) alongside numeric slider controls. This allows users to override numeric values with dynamic CSS expressions while maintaining a fallback to slider mode.Key Changes
SliderRow component (
configurator/src/components/inputs/SliderRow.svelte):rawDefault,currentRaw, andonRawSetto support raw CSS value handlinguserRawModestate to toggle between slider and raw input modesisRawOverridederived state to auto-detect CSS expressions (var, calc, clamp, min, max, env)</>toggle button to switch between modes (visible on hover or when active)BordersPanel (
configurator/src/components/panels/BordersPanel.svelte):BASE_RADIIdefaults (xs: 2→2, s: 4→4, m: 6→8, l: 10→12, xl: 14→16, 2xl: 20→24)RADIUS_FINEarray with new defaults and addedrawDefaultfield with calc expressions (e.g.,calc(8px * var(--sf-radius-scale)))COMPONENT_TOKENSwith new token names (--sf-button-radius → --sf-btn-radius, etc.), adjusted defaults, and addedrawDefaultreferences to spacing/radius variablesgetRadiusValue()andgetComponentVal()to detect and skip CSS expressions, returning defaults insteadLayoutPanel (
configurator/src/components/panels/LayoutPanel.svelte):SpacingPanel (
configurator/src/components/panels/SpacingPanel.svelte):Implementation Details
/^(var|calc|clamp|min|max|env)\(/)https://claude.ai/code/session_011GgFN1mxJWjgGdwV6WGj2B