I want to hide this theme-switcher div from screen readers, as they are needed to change the theme colours. But it should be focusable for keyboard users.
My problem is, it is not allowed to have focusable elements inside an aria-hidden node.
Is there a workaround or best practice for this kind of problems?
<div id="theme-switcher" aria-hidden="true">
<button>Light</button>
<button>Dark</button>
</div>
I think I found the solution.
By implementing a "skip to content" Link, this and any other blocks can be skipped. So there is no need, to add any aria-hidden tag here.