News for hackers. Stuff that matters.
Re:Using <details> for menus and dialogs (2019) by eyelidlessness on Saturday April 24, 2021 @06:49PM (#26928887)
> Now I'm very curious why <summary> is a button.

I’m fairly certain it’s a shadow DOM implementation detail. While it technically toggles a binary state and is probably more semantically similar to a checkbox, I think the way it’s exposed to web APIs makes that either impractical or non-obvious.

Re:Using &lt;details&gt; for menus and dialogs (2019) by hnbad on Sunday April 25, 2021 @05:50AM (#26931528)
"Toggle buttons" are a thing in ARIA: https://developer.mozilla.org/en-US/docs/Web/Accessibility/A...

Conceptually the summary is a toggle button: you click it to toggle the display state of the details element.

Re:Using &lt;details&gt; for menus and dialogs (2019) by eyelidlessness on Sunday April 25, 2021 @11:38AM (#26933544)
That’s true and what I assumed of summary. Although toggle buttons are fairly useless in plain HTML without JS, which is why checkbox is the more obvious semantic analogue outside the shadow DOM.