by shakna · 3y ago · 0 comments
The details element.
<details>
<summary>Menu</summary>
<ul>
<li><a href="/">Home</a></li>
<li><a href="/thing">Thing</a></li>
</ul>
</details>
You may want to add a tiny bit of CSS, like adding a border, and setting the cursor to a pointer, for your sighted users: details {
padding: 0.5em;
border-style: solid;
border-width: 1px;
border-radius: 0.25em;
cursor: pointer;
}Hopefully this will change soon. I’ll amend the article when this will be the case.
Which says JavaScript is required and simplest solution for building this menu. It also states to try to avoid them when possible.
Only if you want to polyfill for pre-2019 browsers
https://adrianroselli.com/2019/04/details-summary-are-not-in...
https://cloudfour.com/thinks/a-details-element-as-a-burger-m...
Now, I found details,& I keep the main page visible all times in a div, & then horizontal accordion styles as Details underneath it for History, Logs & other stuff e.g. https://spa.bydav.in/odo.html (type foo in the box to see page)