Are 'CSS Carousels' accessible?

Sara Soueidan · 2025年5月6日

AI 摘要 AI 生成,可能有误

该文章批判性地审视了新近发布的“CSS 轮播”(CSS Carousels)的无障碍性——这是一组仅用 CSS 实现的滚动 UI 模式,由 CSS Overflow Module 5 规范中定义的 ::scroll-marker 和 ::scroll-button 等新伪元素构建而成。尽管有说法称轮播的无障碍最佳实践由浏览器负责处理,但作者对示例的检查揭示了重大的无障碍性和可用性问题,这主要因为这些交互式伪元素并非真实的 DOM 元素,且这些功能仍处于实验阶段(目前仅在 Chrome Canary 中通过实验性标志启用)。本文旨在提高开发者的无障碍意识,以免他们过早采用这些功能,给辅助技术用户造成令人困惑的使用体验。

✨ This post is sponsored by everyone who has bought my Practical Accessibility course. ✨

“CSS Carousels” were formally introduced a few weeks ago in an article on the Chrome for developers blog, and quite a few people have shared the excitement since then.

When I first heard of them I was very reluctant to jump on the bandwagon of excitement. I will also admit that there was even a small part inside of me that was terrified by the idea. Not only does creating interactive widgets using CSS violate the principle of Separation of Concerns (of which I am an advocate), but also because pretty much every implementation of a CSS-only widget I have seen before has had at least moderate to major accessibility issues.

继续阅读全文

为了尊重作者,这里只展示开头几段。你可以去原文阅读,或者在 HorizonReader 里读:划线做笔记、让 AI 帮忙。

更多来自 Sara Soueidan

The CSS caret-* properties and custom caret accessibility

AI 摘要This article examines the CSS caret-* properties (caret-color, caret-animation, and caret-shape) and the accessibility considerations surrounding the caret, an often-overlooked focus indicator for editable text and caret browsing mode. It explains how caret browsing enables precise keyboard navigation of web pages, and how operating systems like macOS and Windows provide accessibility settings for caret blinking, thickness, and visibility that browsers honor inconsistently. The author urges caution when applying custom caret styles, since the caret may be the only focus indicator some keyboard or pointer users receive.

My top picks for Interop 2027

AI 摘要The author shares their ranked picks for Interop 2027, a yearly project aiming to improve cross-browser interoperability of key web platform features, using Firefox's community ranking page. Their top choices—the HTML focusgroup attribute and the ariaNotify() API—reflect their preference for features that improve both accessibility/user experience and developer experience, followed by other picks like heading-related HTML attributes, Interest Invokers, and various CSS properties. The author notes that features cannot be downvoted, only ranked or left unranked, and concludes by linking to blog posts where other web developers shared their own rankings.

CSS to speech: alternative text for CSS-generated content

AI 摘要The article explains how CSS-generated content inserted via ::before and ::after pseudo-elements is included in an element's accessible name computation, and why meaningful CSS images, icons, and unicode characters need descriptive alternative text while decorative ones should be hidden from screen readers. It introduces the CSS Generated Content Module Level 3 syntax that lets authors provide alternative text after a slash in the content property (with empty-string alt text for decorative content), noting that browser support is now very good except for older browsers like Internet Explorer. The author shares testing results across browsers and screen readers such as VoiceOver, observing that CSS images without alt text are excluded from the accessibility tree, images with alt text are announced properly, and there are some quirks like NVDA not announcing Chrome's CSS image alt text and Safari only showing broken CSS image alt text when VoiceOver is enabled.

🎥 New (Video) Podcast: "Navigating the World of Web Accessibility with Sara Soueidan", with Kevin Powell

AI 摘要The author and Kevin Powell finally recorded a nearly two-hour video podcast about navigating the world of web accessibility, covering topics like HTML semantics, ARIA, screen readers, the accessibility tree, how CSS affects accessibility, and the author's Practical Accessibility course. They also chatted about shared personal interests such as cooking, fermentation, and nutrition. The author invites front-end designers and developers curious about accessibility to watch or listen and share their feedback.

CSS-only scrollspy effect using scroll-marker-group and :target-current

AI 摘要The article explains how to create a CSS-only scrollspy effect using the new scroll-target-group property combined with the :target-current pseudo-class, which automatically highlights navigation links (like a table of contents) when their target sections are scrolled into view—no JavaScript required. It describes how applying scroll-target-group to a container of HTML anchors promotes them to scroll markers, letting the browser determine and style the active link. The author also covers accessibility considerations, including WCAG contrast requirements for active link styling and using aria-current to convey the active state to screen reader users.