Feature/2.x/805 add default accessible label to templates using localgov prev next #806
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Re: #805
What does this change?
This makes several changes:
prevNextAttributes
inprev-next.component.yml
prev_next_nav_aria_label
prop for convenience (i.e. since this can also be set usingprevNextAttributes
)prev_next_pre_content
slot to add content before the Prev and Next linksprev_next_post_content
slot to add content after the Prev and Next linksprev_next_pre_content
slot to add a labelled, visually-hidden heading to Blog templateprev_next_pre_content
slot to add a labelled, visually-hidden heading to Guides templateprev_next_pre_content
slot to add a labelled, visually-hidden heading to Publication templateprev_next_pre_content
slot to add a labelled, visually-hidden heading to Step by Step templateThe new labels all use Drupal's stock pattern: an
aria-labelledby
attribute on the<nav>
element referring to a visually-hidden child<h2>
with a matchingid
attribute.How to test
Test all of the following with demo content (not sure what module the Blog template requires):
How can we measure success?
<nav>
elements wrapping the Prev-Next links will now have an accessible text label by defaultHave we considered potential risks?
For existing overrides of the template, a new
aria-labelledby
andh2
will appear:aria-label
), the<nav>
'saria-labelledby
attribute plus its new label will override the theme's label; this is probably not serious but could be a problem where e.g. the new label string is not translated on a multilingual siteImages
n/a
Accessibility
Colour contrast passedThe change doesn't use only colour to convey meaning