capstone icon indicating copy to clipboard operation
capstone copied to clipboard

list-style:none

Open rebeccacremona opened this issue 5 years ago • 2 comments

There's a bug in Voiceover (and possibly other screen readers) that prevents lists from being announced properly if list-style:none. As a work-around, one can usually add a zero-width space as per the below....

li {
  list-style: none;

  /* Add zero-width space to work around Voiceover bug */
  /* https://unfetteredthoughts.net/2017/09/26/voiceover-and-list-style-type-none/ */
  &:before {
    content: "\200B";
  }
}

... But for some reason here, that breaks the page appearance: the alignment and height of the navbar gets messed up, and there's the possibility other things are breaking more subtlety.

It might be worth investigating why. In the meantime I'll make a mixin that can be applied to lists that obviously don't break.

rebeccacremona avatar Sep 17 '18 17:09 rebeccacremona

This fix, if applied, would also break the .sidebar-menu navigation (the in-page table of contents lists) and the contributor and press lists on the About page.

rebeccacremona avatar Sep 17 '18 18:09 rebeccacremona

This practice is still pervasive throughout the site. I saw a blog post propose using role="list" used where list-style: none; to re-apply list semantics for screen readers. I'll investigate what lists, specifically, are using this and whether their HTML should be updated with role="list".

ChefAndy avatar Sep 13 '21 18:09 ChefAndy