twbs / bootstrap

The most popular HTML, CSS, and JavaScript framework for developing responsive, mobile first projects on the web.
https://getbootstrap.com
MIT License
170.14k stars 78.78k forks source link

Callouts HTML headings level for a11y #37607

Closed hannahiss closed 1 year ago

hannahiss commented 1 year ago

Prerequisites

Describe the issue

On many pages, Bootstrap added callouts to inform, warn or alert readers about specific problems. 33 of them begin with HTML heading.

For those callouts (having a HTML heading), there is sometimes a problem with the title level, which does not follow directly the previous title level, which is recommended for accessibility purposes.

Is a HTML heading really needed there ? It makes the callouts title enter into the page table of contents, which is strange. I would suggest to use a <div> with a class like .h5. Moreover, it would harmonize the look of all callouts having HTML heading (they currently have different headings level and look slightly different).

Among the 33 callouts with HTML heading,15 have a heading level issue (see list below).

Reduced test cases

Screen copy of callout with HTML heading: image


List of callouts having HTML heading:

What operating system(s) are you seeing the problem on?

Windows, macOS, Android, iOS, Linux

What browser(s) are you seeing the problem on?

Chrome, Safari, Firefox, Microsoft Edge, Opera

What version of Bootstrap are you using?

v5.2

patrickhlauke commented 1 year ago

note that skipping heading levels is not strictly an accessibility failure (see some discussion on this here https://github.com/w3c/wcag/issues/655) /cc @mdo