javascript - Does aria-hidden=true mean you don't have to use display:none? -


i have heard applying display:none things not visible more accessible changing opacity. using display:none messes of css animations progressively layered onto core functionality.

is accessible if in css element hidden opacity:0 , give element aria-hidden=true role, or should element have display:none?

another factor considered aria roles controlled javascript (the css has :hover pseudo-class fallback) in instance. environments without javascript element hidden opacity:0.

well, that's how aria-hidden defined:

indicates element , of descendants not visible or perceivable user implemented author. see related aria-disabled.

if element visible after user action, authors must set aria-hidden attribute true. when element presented, authors must set aria-hidden attribute false or remove attribute, indicating element visible. assistive technologies access wai-aria information directly through dom , not through platform accessibility supported browser. authors must set aria-hidden="true" on content not displayed, regardless of mechanism used hide it. allows assistive technologies or user agents skip hidden elements in document.

so i'd "yes".

of course, long have aria-hidden set, it's trivial use actually hide element, non-reader version - [aria-hidden="true"] { visibility: hidden; }, example. ideally, you'd set @ end of "hiding" animation.

in fact, since you're using opacity hide elements, there's no reason use display: none - visibility: hidden fit requirements better.


Comments