forked from shopware/shopware
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'next-35928/skip-to-content' into 'trunk'
NEXT-35928 - Implement skip to main content function to improve accessibility See merge request shopware/6/product/platform!14063
- Loading branch information
Showing
4 changed files
with
43 additions
and
3 deletions.
There are no files selected for viewing
28 changes: 28 additions & 0 deletions
28
changelog/_unreleased/2024-07-01-add-skip-to-content-function-to-improve-a11y.md
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
--- | ||
title: Add skip to content link to improve a11y | ||
issue: NEXT-26705 | ||
--- | ||
# Storefront | ||
* Added new block `base_body_skip_to_content` to `Resources/views/storefront/base.html.twig` | ||
___ | ||
# Upgrade Information | ||
## Add skip to content link to improve a11y | ||
The `base.html.twig` template now has a new block `base_body_skip_to_content` directly after the opening `<body>` tag. | ||
The new block holds a link that allows to skip the focus directly to the `<main>` content element. | ||
This improves a11y because a keyboard or screen-reader user does not have to "skip" through all elements of the page (header, top-bar) and can jump straight to the main content if wanted. | ||
The "skip to main content" link will not be visible, unless it has focus. | ||
|
||
```html | ||
<body> | ||
<div class="skip-to-content bg-primary-subtle text-primary-emphasis visually-hidden-focusable overflow-hidden"> | ||
<div class="container d-flex justify-content-center"> | ||
<a href="#content-main" class="skip-to-content-link d-inline-flex text-decoration-underline m-1 p-2 fw-bold gap-2"> | ||
Skip to main content | ||
</a> | ||
</div> | ||
</div> | ||
|
||
<main id="content-main"> | ||
<!-- Main content... --> | ||
</main> | ||
``` |
This file contains 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
This file contains 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
This file contains 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