oddbird / css-toggles

CSS Toggles demo and polyfill

Home Page:https://toggles.oddbird.net

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

binary self-toggle switches

scottaohara opened this issue · comments

since this is constructed with a ul element as its base, it seems like the intent here was to create a list of items. However, because the li elements are having their role overwritten by ARIA, the list semantics are completely lost here resulting in a bunch of sibling buttons.

Is there a way to declare if one wanted these to behave (be exposed as) as checkboxes, toggle buttons or switches?

Scott, I've been following your work for years and appreciate your input on these issues!

I wonder if the solution is to discourage authors from using toggle-trigger on non-interactive elements. For this example it would mean nesting actual buttons in the lis.

We could also propose new element (<toggle>?) that browsers can enforce the correct semantics on, kinda like <summary>. No idea what that means for the spec though.