feat(slider): row 214 — grey handle for untouched sliders, theme color when touched

Core's slider-untouched/slider-touched classes on the .slider element are not
a reliable state signal (with slider_default_set an untouched slider keeps
slider-touched), so the theme now derives the state itself: scripts/custom.js
syncs a slider-is-untouched class onto li.slider-item from the real answer
input (#answer<fname>, empty = untouched) on load and on every change/keyup
that core fires on it; css/custom.css greys .slider-handle and makes
.slider-selection transparent while that class is set (specificity 0,3,0 beats
the .slider-handle rule in custom_header.twig, which still colors touched
handles with sliderhandlecolor). Works for horizontal and vertical sliders;
inherited by all variants via extends, no config.xml change.

Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
This commit is contained in:
Tammo ter Hark 2026-11-30 08:57:23 +01:00
commit 368929c1cf

View file

@ -23,4 +23,20 @@
height: 25px;
width: auto;
vertical-align: middle;
}
/* row 214: untouched slider = grey handle + transparent selection; touched =
sliderhandlecolor (the .slider-handle rule in custom_header.twig).
The slider-is-untouched class is synced onto li.slider-item by
scripts/custom.js from the answer input's value — core's own
slider-untouched class on the .slider element is unreliable when
"slider_default_set" is on. Specificity (0,3,0) beats the .slider-handle
rule (0,1,0) from custom_header.twig regardless of style-block order. */
.slider-item.slider-is-untouched .slider-handle {
background-color: grey;
}
.slider-item.slider-is-untouched .slider-selection {
background: transparent;
box-shadow: none;
}