diff --git a/configurator/src/components/BrandColorRow.svelte b/configurator/src/components/BrandColorRow.svelte index e6d0df59..0fbad2af 100644 --- a/configurator/src/components/BrandColorRow.svelte +++ b/configurator/src/components/BrandColorRow.svelte @@ -10,9 +10,10 @@ * Layout: * [label] [light swatch | text input] → [dark swatch | "auto" or value] [⟲] */ - import { overrides, setOverride, clearOverride } from '../lib/store.svelte.js'; + import { overrides, setOverride, clearOverride, ui } from '../lib/store.svelte.js'; import { defaultsByName } from '../lib/model.js'; import { computeAutoDark } from '../lib/brandColors.js'; + import { measureBackground } from '../lib/probeHost.js'; import OklchPicker from './OklchPicker.svelte'; /** @type {{ colorKey: string, label: string }} */ @@ -72,6 +73,23 @@ function resetLight() { clearOverride(lightName); } function resetDark() { clearOverride(darkName); } + + // ── Inline shade strip ─────────────────────────────────────────────────── + const SHADE_SUFFIXES = ['-superlight', '-xlight', '-lighter', '', '-darker', '-xdark', '-superdark']; + let shadeColors = $state([]); + + $effect(() => { + void overrides[lightName]; + void overrides[darkName]; + void ui.previewTheme; + queueMicrotask(() => { + shadeColors = SHADE_SUFFIXES.map((s) => { + const rgb = measureBackground(`var(--sf-color-${colorKey}${s})`); + return rgb && rgb !== 'rgba(0, 0, 0, 0)' ? rgb : null; + }); + }); + }); +
+ Body: The quick brown fox jumps over the lazy dog. A short paragraph to show body rhythm and spacing at a glance. +
++ The quick brown fox jumps over the lazy dog. This paragraph demonstrates your body typography — font, size, line-height, and text-wrap — all live. A longer line helps you judge measure and readability at a glance. +
+const scale = computeFluidClamp(minSize, maxSize, minVp, maxVp);
+// → clamp(1rem, 0.5rem + 2.5vw, 1.5rem)
+ + Followed by a body line — judge the size contrast at a glance. +
+Applied to components
+Brand colors + on-color text (auto WCAG black/white)
Brand gradients — --sf-gradient-*
+Directional fade gradients
+Gradient on real content — card + hero strip
+Hero headline
+Gradient background from --sf-gradient-primary
+Full space scale — --sf-space-* (resize viewport to see fluid values)
+--sf-space-{s}
+
+ {s}
+ Component spacing — gaps and padding
+gap: --sf-space-s
+ gap: --sf-space-m
+ gap: --sf-space-l
+ Section padding — --sf-section-pad · --sf-content-gap
+Padding: --sf-section-pad · Gap: --sf-content-gap
+Border radius scale — --sf-radius-*
+{r}
+ Borders on real components
+Border color variants — --sf-color-border-*
+--sf-color-{b}
+ Focus ring — --sf-focus-ring-*
+--sf-focus-ring-width
+ --sf-focus-ring-color
+ --sf-focus-ring-offset
+ Border widths — --sf-border-width-*
+Elevation ramp — --sf-shadow-*
+{s}
+ Shadows on real UI components
+Card — shadow-s
+Subtle lift above background
+Card — shadow-m
+Default card elevation
+Card — shadow-xl
+Modal / overlay elevation
+Specialty shadows
+Inner shadow — --sf-shadow-inner
+Live animations — hit 🐢 above to preview reduced motion
+pulsespinbounceslide·fadeshimmerpingDuration scale — sweeping bar shows the relative timing
+--sf-duration-{d}
+ Easing functions — --sf-ease-* (bar sweeps with each easing)
+--sf-ease-{e}
+
+ Transition on hover — using duration + easing tokens
+Blur scale — --sf-blur-*
+{label}
+ Applied as backdrop-filter — requires a translucent background to be visible.
+Opacity scale — --sf-opacity-*
+{fb}
+ Scrim / overlay — --sf-scrim · --sf-overlay
+Frosted glass — backdrop-filter + surface
+Glass surface
+backdrop-filter: blur + translucent surface color
+