2026-09-26 21:26 UTC
Replies (3)
-
@cwilcox808@c.im 2026-09-26 21:36
@css@front-end.social So a div or span? If it has no content (including no descendant pseudo-elements with content), it's already not in the accessibility tree so `inert` does nothing.
-
@jcsteh@aus.social 2026-09-26 22:11
@css@front-end.social I'd lean toward role=none. It's a little bit safer in the sense that if you one day forgot and stuck content inside that container, only the container would be pruned from the accessibility tree, not the content. In contrast, with inert, the entire subtree gets removed from the accessibility tree, and if it's not interactive, you'd never know because the inert attribute doesn't have any default visual styling. Imo, this makes the inert attribute dangerous and best avoided unless it's absolutely necessary.
-
@VerdettoQR@mastodon.social 2026-09-27 00:20
@css@front-end.social A ::before or ::after on the nearest real element does the same CSS job with no node, so nothing needs inert or role=none. If it must stay a real element, jcsteh's role=none keeps any content added later reachable. Is it there for a hook a pseudo-element cannot give, like a sibling selector?