Problem/Motivation
I believe that we organized the skip to main link under the admin toolbar simply because it looked better and was easier to implement.
Unfortunately it makes it more difficult for keyboard only screen magnifier users to discover it.
It is an unusual pattern to have the first focus link be under the navigation menu visually.
Most keyboard only users would expect to see the skip links at the top of the screen (if they exist). If you are on a high magnification and need to change settings, it’s difficult to find.
Steps to reproduce
See skip to main link
Proposed resolution
Increase z-index of skip link.
Make skip link left aligned.
fix border-radius and add focus style consistent with rest of theme.
Remaining tasks
Review
User interface changes
Before

After

API changes
N/A
Data model changes
N/A
Release notes snippet
N/A
| Comment | File | Size | Author |
|---|---|---|---|
| #36 | Screenshot 2024-05-07 at 8.30.34 AM.png | 145.31 KB | gauravvvv |
| #32 | Screenshot 2024-04-30 at 9.44.26 AM.png | 107.18 KB | smustgrave |
| #22 | 2990766-nr-bot.txt | 90 bytes | needs-review-queue-bot |
| #17 | claro skip link after.png | 21.6 KB | camilledavis |
| #17 | claro skip link before.png | 26.88 KB | camilledavis |
Issue fork drupal-2990766
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
- 9.5.x
changes, plain diff MR !3765
- drupal-2990766-skiplink-location-11x
changes, plain diff MR !5112
Comments
Comment #2
mgiffordComment #3
andrewmacpherson commentedThanks for filing this, I agree we should address it.
I think the centred horizontal position could be an issue too. A safer placing would be the top corner of the viewport, not just top edge. CSS position:fixed + an high z-index should be enough, no? The z-index would be arbitrary, but higher than the toolbar and header region. I presume that should vary between LTR and RTL languages.
I get the "it's visible, so it should look nice" argument. This issue is only about the position relative to the viewport. So long as it's sufficiently clear, I don't care about colours, rounded corners, or whatever. A border/outline will probably enhance the clarity a lot, to satisfy WCAG 1.4.11 Non-text content need for clear focus style.
The BBC use a design where the skip link appears near the left edge of their central main page container column, but this isn't necessarily the viewport edge, if you have a wide monitor and a wide browser window, say. Unusually, they place the skip-link below their logo visually, instead of right at the top. (Aside: Their skip link is also NOT the first control in the tabbing order. It comes after their logo link. Their cookie banner also comes before the skip-link, and has several links inside it, which rather defeats the object of the skip-link, but that's a separate problem.)
Let's look for a few more examples.
Comment #12
camilledavis commentedHere are some options for Claro 9.5 using the theme's white-in-green focus ring:
Comment #14
camilledavis commentedAnd here's a MR using option 1 (partial focus ring with round edge)
Comment #15
camilledavis commentedComment #16
mgiffordGreat to see movement here @camilledavis! Would be nice to be able to close some of these issues from the Before Times.
Can you provide before/after snapshots? You're providing a number of options.
Also looks like these are just CSS changes, there shouldn't be any semantic changes, just visual layout.
Also Andrew noted:
"I think the centred horizontal position could be an issue too. A safer placing would be the top corner of the viewport, not just top edge. CSS position:fixed + an high z-index should be enough, no?"
I has this been addressed? It is difficult to see from the screenshot. If you need help with the bidirectional code, let me know.
Daniel also mentioned the BBC (usually pretty solid to follow their lead), and this is what they have used:
Comment #17
camilledavis commentedHere's a before/after for option 1
(The different options are just for focus ring style, in all 4 options the link is on the top left)
Before:
After:
Comment #18
camilledavis commentedStill need to make a right-aligned version for RTL
Comment #19
smustgrave commentedSeems there is a build failure in the MR.
Also could the issue summary be updated to include the proposed solution please.
Comment #21
gauravvvv commentedUpdated proposed solution
Comment #22
needs-review-queue-bot commentedThe Needs Review Queue Bot tested this issue. It no longer applies to Drupal core. Therefore, this issue status is now "Needs work".
This does not mean that the patch needs to be re-rolled or the MR rebased. Read the Issue Summary, the issue tags and the latest discussion here to determine what needs to be done.
Consult the Drupal Contributor Guide to find step-by-step guides for working with issues.
Comment #23
mgiffordAdding WCAG SC 1.4.11 - https://www.w3.org/WAI/WCAG21/Understanding/non-text-contrast
Comment #26
camilledavis commentedCreated MR for 11.x, just for Claro though. Wondering what to do about Olivero since the skiplink design is different. Would be good to have some input from designers...
Comment #27
smustgrave commentedThink the issue summary could use before/after screenshots of claro, and if not applicable if olivero is included.
Comment #28
camilledavis commentedComment #29
camilledavis commentedComment #30
camilledavis commentedComment #31
camilledavis commentedSeparated Olivero issue into its own issue.
Comment #32
smustgrave commentedUpdated issue summary to use template.
Out of curiosity tried with new navigation module
Change looks good to me.
Comment #33
nod_This fixes it in claro, need to fix umami, it does the same center positioning think as before. Olivero is fine (design is different but it's top-left aligned already)
Comment #34
gauravvvv commentedComment #35
smustgrave commentedLets also include screenshots of umami since the change doesn't appear to be 1 to 1
No RTL needed for Umami?
Comment #36
gauravvvv commentedI have attached after patch screenshot for LTR & RTL.
Comment #37
smustgrave commentedBelieve this is fine.
Comment #43
nod_Fixed css lint error on commit
Committed and pushed 5e0d1efa0a to 11.x and 0b36d01ad6 to 11.0.x and c1f7726488 to 10.4.x and 12b546ca74 to 10.3.x. Thanks!