Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: DAYL-88 Backdrop > Improve a11y docn #5343

Merged
merged 2 commits into from
Jan 24, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions components/backdrop/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Backdrops

The `d2l-backdrop` element displays a semi-transparent backdrop behind a specified sibling target element. It also hides elements other than the target from assistive technologies by applying `aria-hidden="true"`.
Use a backdrop to de-emphasize background elements and draw the user's attention to a dialog or other modal content.

## Backdrop [d2l-backdrop]

Expand Down Expand Up @@ -42,4 +42,10 @@ Elements with `aria-hidden` applied (as well as their descendants) are completel

**When showing a backdrop**: first move focus inside the target, then set the `shown` attribute on the backdrop.

**When hiding a backdrop**: first remove the `shown` attribute on the backdrop, then if appropriate move focus outside the target.
**When hiding a backdrop**: first remove the `shown` attribute on the backdrop, then if appropriate move focus outside the target.

## Accessibility

The backdrop hides background elements from screen reader users by setting `aria-hidden="true"` on all elements other than the target element specified in `for-target`.

Before showing the backdrop, focus should be moved inside the target element — see [Focus Management](#focus-management) for more details.
Loading