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>
[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%);
}
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
π§ 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.