Hacker News new | ask | show | jobs
by earthboundkid 1118 days ago
Why does documentation need any JavaScript at all beyond opening the hamburger menu?
3 comments

No need for javascript for the hamburger menu, it is doable with CSS checkbox, see for example the hamburger menu on https://lanyon.getpoole.com/ .

Or another example, the teddit reddit-frontend has collapseable threads with the summary/details tags, also works without javascript.

The CSS checkbox method is considered bad for accessibility. They’re adding a popover attribute to use for no JS menus instead.
You don't need JavaScript for a hamburger menu, I am doing it with pure HTML. Hint: the <details> tag.
Hint: that’s bad for accessibility.
Hint: there's nothing inherently inaccessible about the <details> tag, it all depends on how you use it.
Why does it even need a hamburger menu?
Because you need to hide nav on mobile, since accessibility requirements from google and other web crawlers will require it to fill the much of the page, or your site won't be indexed.