Skip to content

feat(a11y): use list-style-type: "" instead of list-style: none#42526

Open
mdo wants to merge 1 commit into
v6-devfrom
mdo/list-style-type-a11y
Open

feat(a11y): use list-style-type: "" instead of list-style: none#42526
mdo wants to merge 1 commit into
v6-devfrom
mdo/list-style-type-a11y

Conversation

@mdo

@mdo mdo commented Jun 19, 2026

Copy link
Copy Markdown
Member

Description

Replace list-style: none with list-style-type: "" on list containers.

This ports #41778 to the v6 branch.

Motivation & Context

In Safari, list-style: none removes the element's semantic list role, so lists are no longer announced as such by screen readers. Using list-style-type: "" produces the same visual result (no markers) while preserving the list semantics. See Manuel Matuzović's write-up.

What changed

Applied to genuine <ul>/<ol> containers:

  • scss/_breadcrumb.scss, scss/_nav.scss, scss/_navbar.scss, scss/mixins/_lists.scss (the list-unstyled mixin), and the _list-group.scss comment — direct equivalents of the upstream PR
  • scss/_menu.scss — v6's renamed _dropdown.scss
  • scss/_stepper.scss and site/src/scss/_search.scss — new v6 list containers with the same rationale

Intentionally not changed (these use list-style: none to remove the <summary> disclosure marker, not for lists):

  • scss/_accordion.scss (.accordion-header)
  • site/src/scss/_details.scss (.bd-details-summary)

site/src/scss/_toc.scss needs no change — it already routes through the list-unstyled mixin.

Type of changes

  • New feature (non-breaking change which adds functionality)

In Safari, "list-style: none" removes the list semantic role, so lists are
no longer announced by screen readers. Using "list-style-type: \"\"" keeps the
same visual result while preserving the list role.

Ports #41778 to v6, plus the new v6 list containers (stepper,
menu, docs search results). Summary marker removals (accordion header,
details summary) are intentionally left as "list-style: none".
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Inbox

Development

Successfully merging this pull request may close these issues.

1 participant