Element or group of elements that are hidden with display: none;
are skipped from keyboard focus (tab key) for accessibility reasons. When element turns visible it becomes accessible again, which is great.
Currently I'm using opacity
and right
position in order to create CSS transition. Those styles do not make element skipped from keyboard focus, which is what I want to achieve.
I would like to avoid adding tabindex="-1"
to each of those inner elements if possible.
.element {
background-color: black;
bottom: 0;
left: 0;
opacity: 0;
position: absolute;
right: 100%;
top: 0;
transition: all 0.3s;
&.is-visible {
opacity: 1;
right: 100px;
}
}
I would like to have a way to hide/show element with transition, while keeping it skipped from keyboard focus until it's hidden.