feat(a11y): use list-style-type: "" instead of list-style: none#42526
Open
mdo wants to merge 1 commit into
Open
feat(a11y): use list-style-type: "" instead of list-style: none#42526mdo wants to merge 1 commit into
list-style-type: "" instead of list-style: none#42526mdo wants to merge 1 commit into
Conversation
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".
10 tasks
2 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Replace
list-style: nonewithlist-style-type: ""on list containers.This ports #41778 to the v6 branch.
Motivation & Context
In Safari,
list-style: noneremoves the element's semantic list role, so lists are no longer announced as such by screen readers. Usinglist-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(thelist-unstyledmixin), and the_list-group.scsscomment — direct equivalents of the upstream PRscss/_menu.scss— v6's renamed_dropdown.scssscss/_stepper.scssandsite/src/scss/_search.scss— new v6 list containers with the same rationaleIntentionally not changed (these use
list-style: noneto 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.scssneeds no change — it already routes through thelist-unstyledmixin.Type of changes