Re: [csswg-drafts] [css-overflow] Line-clamp and screen readers (#12859)

> > The same question probably also applies to overflow
> 
> I'm not convinced. `overflow: scroll` hides content, but also gives you a way to access it. `line-clamp` just hides (and if a way to access the hidden content is provided by the author, it's by removing `line-clamp`).

Yes, `overflow: scroll` allows users to access the text, though `hidden` and `clip` don't. (Well, `hidden` does programmatically.) And those two values are usually used when authors work with `text-overflow`.

> In general, I think screen readers, as their names indicates, are intended to give an audio rendition of what's on screen, not an independent audio rendition of the source document regardless of how it's styled.

In general yes, with some exceptions like decorative styling. And I'd argue that truncating text may fall into that category, at least in some cases.

And https://butterpep.com/line-clamp-overflow-ellipsis.html indicates that screen readers do read the full text (but the tested versions are pretty outdated).

> If something is invisible yet read aloud, I believe that can be confusing, for instance in cases where a (partially) sighted user is accessing the page with a screen reader, and cannot easily reconcile what they're hearing with what they're seeing, or in case where a blind user discusses the content of the page with a sighted user, and they have a different understanding of what's there.

I'd say, any confusion in those cases only depends on how much of the content is truncated.

> > Just stopping in the middle of a sentence or even a word seems pretty bad for UX.
> 
> That is exactly the UX that a sighted user is getting, though. As long as the ellipsis or some audio equivalent is rendered, I'm not certain that's an issue.

Screen readers usually don't interpret the context. So, a cut-off word may be read differently than the full word, which may cause confusion.

> That said, I am not personally a screen reader user, nor have I don't user research on this specific question, so my guesses as to what's best are just that: guesses.

I couldn't find a proper rule in the WCAG explicitly targetting truncated text. The only one that comes near seems to be https://www.w3.org/WAI/WCAG22/Understanding/resize-text.

And as we both are sighted users, I guess the best would be if people using screen readers and/or the Accessibility Guidelines Working Group weighed in here.

Sebastian



-- 
GitHub Notification of comment by SebastianZ
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/12859#issuecomment-3370678211 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Monday, 6 October 2025 09:23:27 UTC