DEV Community

Cover image for πŸš€ Chrome 135 Brings `::scroll-button()` and `::scroll-marker()` β€” Say Goodbye to JavaScript Carousels
Ashish prajapati
Ashish prajapati

Posted on

πŸš€ Chrome 135 Brings `::scroll-button()` and `::scroll-marker()` β€” Say Goodbye to JavaScript Carousels

With the release of Chrome 135, web developers finally get access to two powerful new pseudo-elements:

  • ::scroll-button()
  • ::scroll-marker()

These pseudo-elements unlock fully functional carousels, sliders, and scrollable components without a single line of JavaScript.

TL;DR: These new features make interactive scroll experiences accessible, stylable, and keyboard-friendly β€” all from your CSS file.


πŸ†• What Are ::scroll-button() and ::scroll-marker()?

::scroll-button()

This pseudo-element renders scroll control buttons β€” left/right or up/down depending on the scroll direction. You can style them like any element, and users can interact with them out of the box.

::scroll-marker()

Think of this like scrollable radio dots β€” showing the position of each scroll snap point. They’re interactive, accessible, and visual indicators of your scroll progress.

Why They're a Big Deal

  • βœ… Automatically accessible (screen reader + keyboard support)
  • βœ… Pairs with scroll-snap-type
  • βœ… No JavaScript needed
  • βœ… Fully stylable using CSS

πŸ”₯ Real-World Carousel Example (JavaScript Fallback)

Here’s a simple JavaScript-based carousel (for legacy support), which will soon be entirely CSS-driven using ::scroll-button() and ::scroll-marker() in Chrome 135+:

πŸ‘‰ Live Demo Here

<!-- Full working demo with scroll + JS -->
<div class="carousel">
  <!-- Slides -->
</div>
Enter fullscreen mode Exit fullscreen mode

[Full code example here... already shown above]


πŸ’‘ What This Will Look Like in Pure CSS

.scroll-container::scroll-button(start) {
  content: 'β—€';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
}

.scroll-container::scroll-button(end) {
  content: 'β–Ά';
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
}
Enter fullscreen mode Exit fullscreen mode

No JavaScript. No event listeners. Just drop in a scroll-snap container, and the browser handles it.


🎯 Why This Matters

Using ::scroll-button() and ::scroll-marker() means:

  • βœ… Native accessibility (no ARIA hoops to jump through)
  • βœ… Built-in keyboard support
  • βœ… Zero JS needed for sliders
  • βœ… Smaller bundle sizes, better perf

πŸ§ͺ Browser Support (as of Chrome 135)

Browser Support
βœ… Chrome 135+ Full
⚠️ Edge (Chromium) Behind flag
❌ Firefox Not yet
❌ Safari Not yet

To enable the feature in Chrome manually:

chrome://flags/#enable-experimental-web-platform-features
Enter fullscreen mode Exit fullscreen mode

🧠 Final Thoughts

This is a huge leap for native web components. Once Firefox and Safari catch up, we’ll finally have fully accessible carousels and sliders without needing bloated libraries or JS hacks.

Until then β€” progressive enhancement is your best friend.


πŸ™‹β€β™‚οΈ Let’s Talk!

What would you build with ::scroll-button()?

  • A portfolio carousel?
  • A product slider?
  • An onboarding walkthrough?

Should developers ditch JS sliders forever? Or is it too early?


πŸ‘‰ Try the full responsive carousel demo:
πŸ”— https://clever-cocada-9cd821.netlify.app/


Follow me for more frontend deep dives!
#CSS #HTML #Chrome135 #Frontend #WebDev #Accessibility #scrollbutton #nativecarousel #DevTo

Top comments (0)

Some comments may only be visible to logged-in visitors. Sign in to view all comments.