Use semantic HTML so screen readers announce the banner correctly, and ensure the banner is announced when it appears.
The requirement (from the design system site)
Use semantic HTML so screen readers announce the banner correctly, and ensure the banner is announced when it appears.
Why it matters to users
When an error or success banner appears after an action, a sighted user sees it at once, but a screen reader user hears nothing unless it is announced. They may believe their form was sent when it was not.
How to fix it
Give each banner a heading for its title, and place error, warning and success banners in role=alert or role=status, or in an aria-live region that exists before the message is inserted. Then scan again.
How we measure it
Banner has a heading element for its title; banners of type error/warning/success (gup-banner type, alert-danger/warning/success classes, role=alert) also use role=alert/status or sit in an aria-live region. Any other role (region, presentation) does not count. gup-banner passes. Dynamic appearance is not observed; no banner on the pages is not measured. Partly measured: we measure what the public pages show of this rule; the rest needs a review.
The rule on the design system site