Skip to content

Instantly share code, notes, and snippets.

View val-web4's full-sized avatar

V.A.L val-web4

  • France
View GitHub Profile
@val-web4
val-web4 / index.pug
Created February 3, 2026 20:52
No SVG, no image, CSS-only fluid slider with input[type=range]
- let minor = 1, major = 6*minor, max = 6*major;
- let s = min || 0;
- let e = (max === 0 || max) ? max : 100;
- let v = (val === 0 || val) ? val : .5*(s + e);
// put all in a wrapper:
.wrap(role='group' aria-label='slider with ruler' style=`--min: ${s}; --val: ${v}; --max: ${e}`)
// slider:
input#r(type='range' list='l' min=min value=val max=max)
// value display: