News for hackers. Stuff that matters.
Re:Accessible hamburger buttons without JavaScript by enyo on Friday January 27, 2023 @10:04AM (#34546807)
> Screen reader users do not need to open or close menus.

Agreed, but you don’t want keyboard accessible menu items available for users that aren’t visually impaired. Offering a “show menu” button to screen readers is not less accessible to them than skipping the navigation section.

If you’re building a page that is only meant to be used by screen readers, then you are absolutely right.

> Meanwhile, non screen reader users are forced to guess what will be behind the ≡ button this time.

The main menu? Which is behind the same ≡ button on most pages on the internet?

Re:Accessible hamburger buttons without JavaScript by myfonj on Friday January 27, 2023 @10:29AM (#34547083)
> The main menu? Which is behind the same ≡ button on most pages on the internet?

This triple dash thingy (≡) is in this case "identical to" Unicode character, so this is what you'd most probably hear from the screen reader. Other pages (mis)use similar characters, for example "Trigram for heaven". Not very helpful.

Truly accessible active elements must communicate their function through meaningful text, not cryptic astral Unicode from exotic blocks.

Re:Accessible hamburger buttons without JavaScript by jameshart on Friday January 27, 2023 @10:30AM (#34547095)
To be fair the OP hides the trigram from screen readers and provides them with the ‘open menu’ label.
Re:Accessible hamburger buttons without JavaScript by myfonj on Friday January 27, 2023 @10:38AM (#34547198)
No, they did not, they present both "accessible hidden link" and "inaccessible visible label", at least I see no `aria-hidden="true"` in the code [1] on the label right now, I see just:

    <label for="menustate">
      <span class="open">≡</span>
      <span class="close">×</span>
    </label>
(Fact that wording of the link in the article pointing to the codepen is "this codepen" is also … not right.)

[1] https://codepen.io/enyo/pen/yLqjrOR

Re:Accessible hamburger buttons without JavaScript by jameshart on Friday January 27, 2023 @10:56AM (#34547439)
You're right - I guess I assumed they'd added that in the full codepen.
Re:Accessible hamburger buttons without JavaScript by enyo on Friday January 27, 2023 @11:00AM (#34547491)
Oh you’re right, I forgot to add this in the article + codepen. (It’s how the button on the site itself is implemented and I forgot to integrate it)
Re:Accessible hamburger buttons without JavaScript by enyo on Friday January 27, 2023 @11:33AM (#34547965)
The use of this symbol in the article is a placeholder. Obviously nobody would actually use this on their website...
Re:Accessible hamburger buttons without JavaScript by jameshart on Friday January 27, 2023 @10:21AM (#34546993)
Offering a show menu button to screenreader users is accessible but poorly usable. They can’t see the menu. ‘Showing’ and ‘hiding’ mean nothing to them.

And for your keyboard navigators using the visual interface, perhaps this hints that you could afford them a similar opportunity - where, from being focused on the menu, they could either descend into the menu, expanding it, or skip the menu and move focus to the next control. That’s how most OS/application keyboard accessible menus work - they don’t have ‘expand’ and ‘collapse’ affordances at all.

Re:Accessible hamburger buttons without JavaScript by enyo on Friday January 27, 2023 @11:09AM (#34547594)
Mh.. yes I agree. "Expand menu" and “Collapse menu" is probably a better wording.
Re:Accessible hamburger buttons without JavaScript by frereubu on Friday January 27, 2023 @12:56PM (#34549371)
It's an interesting distinction for sure. Perhaps "Activate menu" and "Deactivate menu" would work too, particularly as there's no reference to visual things - what would "expanding" on the screen mean in the context of a blind user?
Re:Accessible hamburger buttons without JavaScript by frosted-flakes on Friday January 27, 2023 @04:12PM (#34551931)
Not all screen reader users are blind though. There are plenty of people with enough vision to see the screen, but cannot easily read the text on the screen. And on mobile where users interact with the screen reader via the touch screen, expand/collapse or show/hide fit the bill perfectly.
Re:Accessible hamburger buttons without JavaScript by clairity on Friday January 27, 2023 @02:35PM (#34550665)
blind folks aren't dumb. they can analogize what 'show' and 'hide' mean in context (not to say that this shouldn't be made better).

in any case, i agree that there's a lot going on to add affordances for keyboard users that screenreader users don't need. screenreaders would just need the <nav> element (probably should be aria-labeled too) and the <ul> link list.

it's neat but a little convoluted. i'd also vote for using a <button> rather than a checkbox plus anchors, but buttons do have technical limitations (as noted elsewhere) that browser engines should fix (similar to how dialog elements are now nearly javascript-less, only requiring a `showModal()` call to open), rather than having to have authors work around them.

Re:Accessible hamburger buttons without JavaScript by jameshart on Friday January 27, 2023 @11:27AM (#34547840)
The 'main' menu? Implying, there are other menus.

So is the ≡ the main navigation menu?

The account options menu?

The preferences menu?

The menu of the application platform that's wrapping the page you're on, rather than the page itself?

The menu showing all the sister companies of the site you're on?