5 ms·
If what you are looking for, is a JS-less popover experience, you can already do much of this with a label, a checkbox, and the next sibling selector. The label
by janosdebugs 3y ago
If what you are looking for, is a JS-less popover experience, you can already do much of this with a label, a checkbox, and the next sibling selector. The label can act as the clickable interface to drive the checkbox, while the checkbox can drive the display of the popover.
- rpastuszak 3y agoHow does this work from the accessibility pov?
- janosdebugs 3y agoAlmost perfectly, the only issue I found was having to set the aria-modal with JS for the popover if I remember correctly. Tested it with screen readers on Android and iOS. (We built the website on my profile page with this, if I remember correctly, I'm not at my computer right now.)
- extra88 3y agoThe checkbox's checked/unchecked state is not a good way to convey a popover state. Some other limitations of the checkbox hack compared to this new `popover` attribute: * doesn't support closing a popover by pressing the ESC key, something interfaces that can overlap other content should support * doesn't support closing by clicking anywhere outside the popover