Slider
input type=range with a styled track and thumb. Keyboard stepping, Home/End, form participation — all native.
scroll-driven
How it works
- The
<input>is a transparent 16px box (h-4 bg-transparent) holding the thumb; the visible track is the runnable-track pseudo (::-webkit-slider-runnable-track/::-moz-range-track, bothh-1.5 bg-secondary rounded-full). The thumb is styled twice ([&::-webkit-slider-thumb]:and[&::-moz-range-thumb]:) and each engine ignores the other’s selectors because every utility compiles to its own rule. - On WebKit the 16px thumb rides a 6px track, so
[&::-webkit-slider-thumb]:-mt-[5px]recenters it ((16 − 6) / 2). Firefox aligns::-moz-range-thumbwith::-moz-range-trackautomatically. - The fill is the load-bearing trick. Firefox fills the left of the track natively with
[&::-moz-range-progress]:bg-primary. WebKit has no filled-track pseudo-element, so the fill is scroll-driven: the thumb exposes aview-timeline, the input reads it viatimeline-scope, and ananimationdrives a registered--range-fillproperty that alinear-gradientpaints onto the track — a pure function of thumb position, no JS oroninput. This block lives in a separate CSS file because@propertyandview-timelinehave no utility form.
The fallback story
- Without scroll-driven animations,
@supportsskips the block: WebKit/Chromium show a plain secondary track with no fill, Firefox still fills natively via::-moz-range-progress. The slider stays fully usable — only the progress-style fill on WebKit is missing.
Browser support
Minimum stable version per engine, resolved at build time from MDN's browser-compat-data; Baseline status from the official web-features dataset. Everything degrades gracefully — the “when missing” column is the actual behavior, not a broken page.
| Feature | Chrome | Edge | Firefox | Safari | When missing |
|---|---|---|---|---|---|
| Scroll-driven animations (view-timeline / timeline-scope)† | 116 | 116 | ✕ | 26 | WebKit/Chromium show a plain secondary track with no filled portion; Firefox still fills natively via ::-moz-range-progress. The slider stays fully usable — only the progress-style fill is missing. |
† The badge tests animation-timeline as a stand-in — the range fill also needs view-timeline, timeline-scope and @property, which all shipped together with scroll-driven animations in every engine that has them.