-
Notifications
You must be signed in to change notification settings - Fork 7
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
Add support for multiple skip links in header #189
Conversation
app/views/records.html
Outdated
@@ -4,6 +4,24 @@ | |||
{% set backLink = 'false' %} | |||
{% set navActive = "records" %} | |||
|
|||
{% block skipLink %} | |||
|
|||
<div class="app-skip-link--container"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider indenting app-skip-link--container
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! fixed.
app/views/records.html
Outdated
<span class="app-skip-link--item"> | ||
{{ govukSkipLink({ | ||
href: '#records-list', | ||
text: 'Skip to results' if selectedFilters else 'Skip to records' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice!
@@ -0,0 +1,99 @@ | |||
$important: true; | |||
|
|||
// This is basically a copy of the Design System govuk-visually-hidden-focusable mixin |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not related to your code but I find a bunch of the design system css so hard to read. 🧐
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks great Ed. I gave it a test in a legitimate ie11 instance too and the fallback works well.
Our service has a number of filters you can apply to filter a group of records. We recently used the accessibility personas to review these pages - and felt it would be good to provide a way of skipping past the filters to the results.
In this pr I'm experimenting by adding a second skip link in to the header. This uses the newish
:focus-within
property to show the skip-link div if either of the children links are focussed. This should gracefully degrade in browsers that don't support the property to just show two skip links in turn.The css is mostly copied styles from the
govuk-skip-link
component, but applied to the header instead. If the browser supports:focus-within
I then remove some of the default styles from the skip links themselves.Video:
Without support for the property: