Skip to content

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

Merged
mdo merged 1 commit into
v6-devfrom
mdo/list-style-type-a11y
Jun 21, 2026
Merged

feat(a11y): use list-style-type: "" instead of list-style: none#42526
mdo merged 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".
@mdo mdo requested a review from a team as a code owner June 19, 2026 04:16
@mdo mdo added this to v6.0.0 Jun 19, 2026
@github-project-automation github-project-automation Bot moved this to Inbox in v6.0.0 Jun 19, 2026
@mdo mdo merged commit be60e6a into v6-dev Jun 21, 2026
12 checks passed
@mdo mdo deleted the mdo/list-style-type-a11y branch June 21, 2026 04:52
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