Make site-alert more accessible to screenreaders
Describe the bug
The site-alert component doesn’t have any way of raising its importance to screen readers. I consider this a usability/a11y bug, but may be more appropriate as a feature.
Steps to reproduce the bug
- Start a session with a site-alert, or have a site alert appear during a session (e.g. via a flag for emergency site maintenance)
- Either way, if a user were to use a screenreader to skip to
<main>, or tab to the first button/field, or use the rotor menu (and the no-header variant is used), the alert is always skipped and effectively invisible without having SR read all content from the top.
Expected behavior
Should use a landmark role to be readily available to screenreaders, and be considered a live region in case it is important and updates within a session. This is especially true if it does not have a header and thus doesn't show up on the rotor menu either.
Status might be the most semantically appropriate role, and it would already use the ‘polite’ aria-live setting to announce a change if it comes up (e.g. suddenly a “this website will be down for maintenance in 1 hour” appears).
Alternatively, the Region role type (with none/polite aria-live setting) would at least make it appear on rotor menus in the headerless variant.
Related to #3832