Comments on: Custom Range Slider Using Anchor Positioning & Scroll-Driven Animations https://frontendmasters.com/blog/custom-range-slider-using-anchor-positioning-scroll-driven-animations/ Helping Your Journey to Senior Developer Tue, 04 Nov 2025 00:46:28 +0000 hourly 1 https://wordpress.org/?v=6.8.3 By: Temani Affi https://frontendmasters.com/blog/custom-range-slider-using-anchor-positioning-scroll-driven-animations/#comment-19457 Tue, 14 Jan 2025 21:04:15 +0000 https://frontendmasters.com/blog/?p=3569#comment-19457 In reply to pery.

The –min and –max are defined on the output element (inline style) and the animation rely on them. You have to move them to label as well.

]]>
By: pery https://frontendmasters.com/blog/custom-range-slider-using-anchor-positioning-scroll-driven-animations/#comment-19453 Tue, 14 Jan 2025 19:03:15 +0000 https://frontendmasters.com/blog/?p=3569#comment-19453 i try to move

animation: range linear both;
animation-timeline: --thumb-view;
animation-range: entry 100% exit 0%;

to the label css section:

label {
  timeline-scope: --thumb-view; /* limit the scopes of the anchor to the label */
  anchor-scope: --thumb;
  position: relative;

  --c: var(--color-primary, Orange); /* active color */
  --g: round(.3em, 1px); /* the gap */
  --l: round(.2em, 1px); /* line thickness*/
  --s: round(1em, 1px); /* thumb size*/

  animation: range linear both;
  animation-timeline: --thumb-view;
  animation-range: entry 100% exit 0%;

  &:before {
    background-color: red;
    content: counter(num);
    counter-reset: num var(--val);
  }

  ...
}

and everything broke and the variable --val not set by the animation .
why is that ?

basically i want the slider be a hue selector and change the thumb background-color to the selected hue.
so i need the variable scope bubble up and be visible by the <output> and the thumb

]]>
By: Michał Rełkowski https://frontendmasters.com/blog/custom-range-slider-using-anchor-positioning-scroll-driven-animations/#comment-10509 Wed, 28 Aug 2024 20:37:33 +0000 https://frontendmasters.com/blog/?p=3569#comment-10509 Wow! I need to refresh my knowledge of CSS. I never expected such magic without JS. Very nice effect.

]]>