From bffa52c1bc52c15772d12ad2ac046955a593597c Mon Sep 17 00:00:00 2001 From: Calvin Lau <77630796+calvin-lau-sig7@users.noreply.github.com> Date: Tue, 5 Dec 2023 11:27:26 +0000 Subject: [PATCH] Adding WCAG 2.2 content to website Co-Authored-By: Anika Henke <108893+selfthinker@users.noreply.github.com> Co-Authored-By: Charlotte Downs <56260216+CharlotteDowns@users.noreply.github.com> Co-Authored-By: David Cox <98318778+dav-idc@users.noreply.github.com> --- config/navigation.js | 5 + ...sibility.md => accessibility-statement.md} | 6 +- src/accessibility/WCAG-2.2/index.md | 393 ++++++++++++++++++ .../accessibility-strategy/index.md | 5 +- src/accessibility/index.md | 18 + src/components/back-link/index.md | 11 +- src/components/breadcrumbs/index.md | 5 +- src/components/button/index.md | 3 + src/components/cookie-banner/index.md | 3 + src/components/error-message/index.md | 9 + src/components/file-upload/index.md | 14 + src/components/footer/index.md | 4 + src/components/header/index.md | 13 +- src/components/panel/index.md | 11 + src/components/phase-banner/index.md | 3 + src/components/select/index.md | 7 + src/components/summary-list/index.md | 48 +++ src/components/tag/index.md | 10 +- src/index.njk | 2 +- src/patterns/addresses/index.md | 14 + src/patterns/bank-details/index.md | 14 + .../check-a-service-is-suitable/index.md | 13 + src/patterns/check-answers/index.md | 7 +- src/patterns/complete-multiple-tasks/index.md | 11 +- src/patterns/confirm-a-phone-number/index.md | 7 +- .../confirm-an-email-address/index.md | 4 + src/patterns/confirmation-pages/index.md | 13 +- .../index.md | 9 + src/patterns/cookies-page/index.md | 3 + src/patterns/create-accounts/index.md | 14 + src/patterns/email-addresses/index.md | 15 + src/patterns/equality-information/index.md | 17 + src/patterns/names/index.md | 12 + .../national-insurance-numbers/index.md | 14 + src/patterns/page-not-found-pages/index.md | 3 + src/patterns/passwords/index.md | 18 +- src/patterns/payment-card-details/index.md | 4 + .../problem-with-the-service-pages/index.md | 16 + src/patterns/question-pages/index.md | 12 + .../service-unavailable-pages/index.md | 3 + src/patterns/start-using-a-service/index.md | 6 +- src/patterns/validation/index.md | 10 + src/styles/images/index.md | 4 +- src/stylesheets/main.scss | 8 + 44 files changed, 798 insertions(+), 23 deletions(-) rename src/{accessibility.md => accessibility-statement.md} (98%) create mode 100644 src/accessibility/WCAG-2.2/index.md rename src/{community => accessibility}/accessibility-strategy/index.md (99%) create mode 100644 src/accessibility/index.md diff --git a/config/navigation.js b/config/navigation.js index 16d217f96f..5fd49f8bc4 100644 --- a/config/navigation.js +++ b/config/navigation.js @@ -23,6 +23,11 @@ module.exports = [ { label: 'Community', url: 'community' + }, + { + label: 'Accessibility', + url: 'accessibility', + includeInSearch: true } ] diff --git a/src/accessibility.md b/src/accessibility-statement.md similarity index 98% rename from src/accessibility.md rename to src/accessibility-statement.md index 20cfe5e840..f12a3f39ec 100644 --- a/src/accessibility.md +++ b/src/accessibility-statement.md @@ -1,10 +1,10 @@ --- -title: Accessibility +title: Accessibility statement description: accessibility in the GOV.UK Design System layout: layout-single-page-prose.njk --- -# Accessibility +# Accessibility statement The GOV.UK Design System team at the Government Digital Service (GDS) maintains the following products: @@ -16,7 +16,7 @@ This page explains how the team works to ensure these products are accessible. The GOV.UK Prototype Kit website has a separate accessibility statement. [Read the GOV.UK Prototype Kit website accessibility statement](https://prototype-kit.service.gov.uk/docs/accessibility). -[Read our accessibility strategy](https://design-system.service.gov.uk/community/accessibility-strategy/) for more information on our current principles and work needed to improve the accessibility of the GOV.UK Design System. +[Read our accessibility strategy](https://design-system.service.gov.uk/accessibility/accessibility-strategy/) for more information on our current principles and work needed to improve the accessibility of the GOV.UK Design System. [Read about how we test components using accessibility acceptance criteria](https://github.com/alphagov/govuk-frontend/blob/main/docs/contributing/test-components-using-accessibility-acceptance-criteria.md). diff --git a/src/accessibility/WCAG-2.2/index.md b/src/accessibility/WCAG-2.2/index.md new file mode 100644 index 0000000000..1977eefeb0 --- /dev/null +++ b/src/accessibility/WCAG-2.2/index.md @@ -0,0 +1,393 @@ +--- +title: Changes to the Design System to meet WCAG 2.2 +description: Outlines the current principles and work needed to improve the accessibility of the GOV.UK Design System +section: Accessibility +layout: layout-pane.njk +showPageNav: true +order: 2 +--- + +{% from "govuk/components/table/macro.njk" import govukTable %} + +W3C owns and manages the [Web Content Accessibility Guidelines (WCAG) 2.2](https://www.w3.org/TR/WCAG22/). + +In 2023, the Design System team assessed and updated the GOV.UK Design System to comply with the new criteria and recommendations given in WCAG 2.2. + +Any guidance we provide is to make sure teams using the Design System are aware of the changes and can make the necessary adjustments to their services. + +### Make sure your service meets the new WCAG 2.2 criteria + +WCAG 2.2 was published in October 2023. You’ll need to comply with the new criteria no later than October 2024. See more about [Meeting government accessibility requirements](https://www.gov.uk/service-manual/helping-people-to-use-your-service/understanding-wcag) in the GOV.UK Service Manual. + +### What you need to do + +1. Revisit the [Government Digital Service (GDS) guidance](https://www.gov.uk/guidance/accessibility-requirements-for-public-sector-websites-and-apps) on accessibility is and why your service needs to invest in it +2. Read [What’s new in WCAG 2.2](https://www.w3.org/WAI/standards-guidelines/wcag/new-in-22/) to understand the new criteria your service will need to comply with +3. Ask your wider organisation for support to prepare for work needed to meet WCAG 2.2 +4. Review the lists on this page of affected components and patterns in the Design System +5. Assess your service to see how many affected components and patterns are in use +6. Plan and implement the changes needed to your service + +Make sure there's expertise within your organisation by advocating for people to receive training in accessibility. To provide some help with this, the Design System team is [organising community events](/community/) to help service teams share information with each other. + +### Components and patterns affected in the Design System + +We've made changes to these components and patterns to comply with WCAG 2.2 level AA. You must check if your service needs amending to align with these changes. + +[Images](/styles/images/) also includes guidance to help ensure icons and images in your service meet Target Size (minimum). + +{{ govukTable({ + caption: "Components", + captionClasses: "govuk-table__caption--m", + head: [ + { + text: "Component", + classes: "govuk-!-width-one-half" + }, + { + text: "Relevant WCAG 2.2 criteria", + classes: "govuk-!-width-one-half" + } + ], + rows: [ + [ + { + html: 'Back link' + }, + { + html: 'Redundant entry
Target size (minimum)' + } + ], + [ + { + html: 'Breadcrumbs' + }, + { + html: 'Target size (minimum)' + } + ], + [ + { + html: 'Button' + }, + { + html: 'Target size (minimum)' + } + ], + [ + { + html: 'Cookie banner' + }, + { + html: 'Focus not obscured (minimum)
Target size (minimum)' + } + ], + [ + { + html: 'Error message' + }, + { + html: 'Redundant entry' + } + ], + [ + { + html: 'File upload' + }, + { + html: 'Dragging movements
Redundant entry' + } + ], + [ + { + html: 'Footer' + }, + { + html: 'Consistent help' + } + ], + [ + { + html: 'Header' + }, + { + html: 'Focus not obscured (Minimum)
Focus appearance' + } + ], + [ + { + html: 'Panel' + }, + { + html: 'Redundant entry' + } + ], + [ + { + html: 'Phase banner' + }, + { + html: 'Focus not obscured (minimum)' + } + ], + [ + { + html: 'Select' + }, + { + html: 'Dragging movements' + } + ], + [ + { + html: 'Summary list' + }, + { + html: 'Redundant entry
Target size (minimum)' + } + ], + [ + { + html: 'Tag' + }, + { + html: 'Dragging movements
Focus appearance' + } + ] + ] +}) }} + +{{ govukTable({ + caption: "Patterns to ask users for information", + captionClasses: "govuk-table__caption--m", + head: [ + { + text: "Ask users for...", + classes: "govuk-!-width-one-half" + }, + { + text: "Relevant WCAG 2.2 criteria", + classes: "govuk-!-width-one-half" + } + ], + rows: [ + [ + { + html: 'Addresses' + }, + { + html: 'Redundant entry' + } + ], + [ + { + html: 'Bank details' + }, + { + html: 'Redundant entry' + } + ], + [ + { + html: 'Email addresses' + }, + { + html: 'Redundant entry' + } + ], + [ + { + html: 'Equality information' + }, + { + html: 'Redundant entry' + } + ], + [ + { + html: 'Names' + }, + { + html: 'Redundant entry' + } + ], + [ + { + html: 'National Insurance Numbers' + }, + { + html: 'Redundant entry' + } + ], + [ + { + html: 'Passwords' + }, + { + html: 'Accessible authentication
Consistent help
Target size (minimum)' + } + ], + [ + { + html: 'Payment card details' + }, + { + html: 'Redundant entry' + } + ] + ] +}) }} + +{{ govukTable({ + caption: "Patterns to help users do things", + captionClasses: "govuk-table__caption--m", + head: [ + { + text: "Help users to...", + classes: "govuk-!-width-one-half" + }, + { + text: "Relevant WCAG 2.2 criteria", + classes: "govuk-!-width-one-half" + } + ], + rows: [ + [ + { + html: 'Check a service is suitable' + }, + { + html: 'Redundant entry' + } + ], + [ + { + html: 'Check answers' + }, + { + html: 'Redundant entry' + } + ], + [ + { + html: 'Complete multiple tasks' + }, + { + html: 'Dragging movements
Redundant entry' + } + ], + [ + { + html: 'Confirm a phone number' + }, + { + html: 'Consistent help' + } + ], + [ + { + html: 'Confirm an email address' + }, + { + html: 'Accessible authentication' + } + ], + [ + { + html: 'Contact a department or service team' + }, + { + html: 'Consistent help' + } + ], + [ + { + html: 'Create accounts' + }, + { + html: 'Accessible authentication
Redundant entry' + } + ], + [ + { + html: 'Start using a service' + }, + { + html: 'Focus appearance' + } + ], + [ + { + html: 'Recover from validation errors' + }, + { + html: 'Redundant entry' + } + ] + ] +}) }} + +{{ govukTable({ + caption: "Page patterns", + captionClasses: "govuk-table__caption--m", + head: [ + { + text: "Page", + classes: "govuk-!-width-one-half" + }, + { + text: "Relevant WCAG 2.2 criteria", + classes: "govuk-!-width-one-half" + } + ], + rows: [ + [ + { + html: 'Confirmation pages' + }, + { + html: 'Dragging movements
Focus appearance
Redundant entry' + } + ], + [ + { + html: 'Cookies page ' + }, + { + html: 'Redundant entry' + } + ], + [ + { + html: 'Page not found pages' + }, + { + html: 'Consistent help' + } + ], + [ + { + html: 'Question pages' + }, + { + html: 'Dragging movements
Redundant entry' + } + ], + [ + { + html: 'Service unavailable pages' + }, + { + html: 'Consistent help' + } + ], + [ + { + html: 'There is a problem with the service pages' + }, + { + html: 'Consistent help' + } + ] + ] +}) }} diff --git a/src/community/accessibility-strategy/index.md b/src/accessibility/accessibility-strategy/index.md similarity index 99% rename from src/community/accessibility-strategy/index.md rename to src/accessibility/accessibility-strategy/index.md index 15223e6b1d..daa6443e0e 100644 --- a/src/community/accessibility-strategy/index.md +++ b/src/accessibility/accessibility-strategy/index.md @@ -1,11 +1,10 @@ --- title: Accessibility strategy description: Outlines the current principles and work needed to improve the accessibility of the GOV.UK Design System -section: Community -theme: How we work +section: Accessibility layout: layout-pane.njk showPageNav: true -order: 9 +order: 3 --- This accessibility strategy outlines the current principles and work needed to improve the accessibility of the GOV.UK Design System. diff --git a/src/accessibility/index.md b/src/accessibility/index.md new file mode 100644 index 0000000000..6b564b32b4 --- /dev/null +++ b/src/accessibility/index.md @@ -0,0 +1,18 @@ +--- +layout: layout-pane.njk +title: Accessibility +description: tbd +showSubNav: true +--- + +Our work to make the GOV.UK Design System meet public sector accessibility regulations is a continuous and iterative process. You must [make sure your service is accessible](https://www.gov.uk/guidance/accessibility-requirements-for-public-sector-websites-and-apps). We outline our approach on our [accessibility strategy](/accessibility/accessibility-strategy/). + +Using the GOV.UK Design System in a service does not immediately make that service accessible. You’ll need additional research, design, development and testing work to make sure your service is accessible, even when using accessible styles, components and patterns. + +### Accessibility changes to the Design System to meet WCAG 2.2 + +[Read our guidance on the Web Content Accessibility Guidelines (WCAG) 2.2](/accessibility/WCAG-2.2) to make sure teams using the Design System are aware of the changes and can make the necessary adjustments to their services. + +### Accessibility strategy + +[Read our accessibility strategy](/accessibility/accessibility-strategy/) for more information on our current principles and work needed to improve the accessibility of the GOV.UK Design System. diff --git a/src/components/back-link/index.md b/src/components/back-link/index.md index 8fe5000ddf..6afcb1284a 100644 --- a/src/components/back-link/index.md +++ b/src/components/back-link/index.md @@ -8,6 +8,7 @@ layout: layout-pane.njk --- {% from "_example.njk" import example %} +{% from "govuk/components/tag/macro.njk" import govukTag %} Use the back link component to help users go back to the previous page in a multi-page transaction. @@ -29,9 +30,15 @@ Never use the back link component together with [breadcrumbs](/components/breadc Always place back links at the top of a page, before the `
` element. Placing them here means that the 'Skip to main content' link allows the user to skip all navigation links, including the back link. -Make sure the link takes users to the previous page they were on, in the state they last saw it. Where possible, ensure it works even when JavaScript is not available. +Make sure the link takes users to the previous page they were on, in the state they last saw it. -If this is not possible, you should hide the back link when JavaScript is not available. +WCAG 2.2 If a user decides to go back to a previous page, make sure information they have already entered is pre-populated. + +Do not pre-populate if the information is no longer valid, or when pre-populating would be a major safety or security concern. This is to comply with WCAG 2.2 success criterion [3.3.7 Redundant Entry](https://www.w3.org/WAI/WCAG22/Understanding/redundant-entry.html). + +WCAG 2.2 Make sure no other interactive elements are too close to the back link. This is to make sure users can easily interact with the back link. This relates to WCAG 2.2 success criterion [2.5.8 Target Size (minimum)](https://www.w3.org/WAI/WCAG22/Understanding/target-size-minimum.html). + +Where possible, ensure the back link works even when JavaScript is not available. If this is not possible, you should hide the back link when JavaScript is not available. There are 2 ways to use the back link component. You can use HTML or, if you are using [Nunjucks](https://mozilla.github.io/nunjucks/) or the [GOV.UK Prototype Kit](https://prototype-kit.service.gov.uk), you can use the Nunjucks macro. diff --git a/src/components/breadcrumbs/index.md b/src/components/breadcrumbs/index.md index fb93aa4579..81883b7fcc 100644 --- a/src/components/breadcrumbs/index.md +++ b/src/components/breadcrumbs/index.md @@ -8,6 +8,7 @@ layout: layout-pane.njk --- {% from "_example.njk" import example %} +{% from "govuk/components/tag/macro.njk" import govukTag %} The breadcrumbs component helps users to understand where they are within a website’s structure and move between levels. @@ -27,7 +28,9 @@ If you’re using other navigational elements on the page, such as a sidebar, co Always place breadcrumbs at the top of a page, before the `
` element. Placing them here means that the 'Skip to main content' link allows the user to skip all navigation links, including breadcrumbs. -The breadcrumb should start with your 'home' page and end with the parent section of the current page. +The breadcrumbs should start with your 'home' page and end with the parent section of the current page. + +WCAG 2.2 Make sure no other interactive elements are too close to the breadcrumbs. This is to make sure users can easily interact with the breadcrumbs. This relates to WCAG 2.2 success criterion [2.5.8 Target Size (minimum)](https://www.w3.org/WAI/WCAG22/Understanding/target-size-minimum.html). There are 2 ways to use the breadcrumbs component. You can use HTML or, if you are using [Nunjucks](https://mozilla.github.io/nunjucks/) or the [GOV.UK Prototype Kit](https://prototype-kit.service.gov.uk), you can use the Nunjucks macro. diff --git a/src/components/button/index.md b/src/components/button/index.md index 226d094f85..155d4e1431 100644 --- a/src/components/button/index.md +++ b/src/components/button/index.md @@ -8,6 +8,7 @@ layout: layout-pane.njk --- {% from "_example.njk" import example %} +{% from "govuk/components/tag/macro.njk" import govukTag %} {{ example({ group: "components", item: "button", example: "default", html: true, nunjucks: true, open: false, loading: "eager" }) }} @@ -34,6 +35,8 @@ You may need to include more or different words to better describe the action. F Align the primary action button to the left edge of your form. +WCAG 2.2 Do not decrease the height or target area of buttons. This is to make sure users can easily interact with buttons. This is to comply with WCAG 2.2 success criterion [2.5.8 Target Size (minimum)](https://www.w3.org/WAI/WCAG22/Understanding/target-size-minimum.html). + There are 2 ways to use the button component. You can use HTML or, if you are using [Nunjucks](https://mozilla.github.io/nunjucks/) or the [GOV.UK Prototype Kit](https://prototype-kit.service.gov.uk), you can use the Nunjucks macro. ### Default buttons diff --git a/src/components/cookie-banner/index.md b/src/components/cookie-banner/index.md index b0cbfb71a7..7b19d12017 100644 --- a/src/components/cookie-banner/index.md +++ b/src/components/cookie-banner/index.md @@ -8,6 +8,7 @@ layout: layout-pane.njk --- {% from "_example.njk" import example %} +{% from "govuk/components/tag/macro.njk" import govukTag %} Allow users to accept or reject cookies which are not essential to making your service work. @@ -63,6 +64,8 @@ Make sure the cookie banner does not: Position the cookie banner after the opening `` tag and before the ’skip to main content‘ link. If you're using the Nunjucks page template, use the `bodyStart` block. +WCAG 2.2 Do not make the cookie banner ‘sticky’ to the top of the page by using `position: fixed` or any other method. This is to make sure it does not cover or obscure any content which has a focus applied. This is to comply with WCAG 2.2 success criterion [2.4.11 Focus not Obscured (minimum)](https://www.w3.org/WAI/WCAG22/Understanding/focus-not-obscured-minimum.html). + ### Option 1: If you’re only using essential cookies You can choose not to have a cookie banner if the service only sets essential or 'strictly necessary' cookies, as these do not need user consent. diff --git a/src/components/error-message/index.md b/src/components/error-message/index.md index f94edd2480..f622bbcaf0 100644 --- a/src/components/error-message/index.md +++ b/src/components/error-message/index.md @@ -8,6 +8,7 @@ layout: layout-pane.njk --- {% from "_example.njk" import example %} +{% from "govuk/components/tag/macro.njk" import govukTag %} This guidance is for government teams that build online services. [To find information and services for the public, go to GOV.UK](https://www.gov.uk/). @@ -41,6 +42,14 @@ For each error: - use a red border to visually connect the message and the question it belongs to - if the error relates to a specific field within the question, give it a red border and refer to that field in the error message - for example: "you must enter a year" +WCAG 2.2 Do not clear any form fields when adding error messages. This is to comply with WCAG 2.2 success criterion [3.3.7 Redundant Entry](https://www.w3.org/WAI/WCAG22/Understanding/redundant-entry.html). + +Keeping information that caused errors helps users to: + +- see what went wrong +- edit their previous answer +- avoid re-entering information + To help screen reader users, the error message component includes a hidden 'Error:' before the error message. These users will hear, for example, "Error: The date your passport was issued must be in the past". If your error message is written in another language, you can change the prefix as needed, as shown in this example. diff --git a/src/components/file-upload/index.md b/src/components/file-upload/index.md index 4f74d9124f..dd917493d7 100644 --- a/src/components/file-upload/index.md +++ b/src/components/file-upload/index.md @@ -8,6 +8,7 @@ layout: layout-pane.njk --- {% from "_example.njk" import example %} +{% from "govuk/components/tag/macro.njk" import govukTag %} This guidance is for government teams that build online services. [To find information and services for the public, go to GOV.UK](https://www.gov.uk/). @@ -21,6 +22,19 @@ You should only ask users to upload something if it’s critical to the delivery ## How it works +To upload a file, the user can either: + +- use the ‘Choose file’ button +- ‘drag and drop’ a file into the file upload input area + +WCAG 2.2 Do not use ‘drag and drop’ as the only way to upload files. You must provide another method, such as the ‘Choose file’ button. This is to comply with WCAG 2.2 success criterion [2.5.7 Dragging Movements](https://www.w3.org/WAI/WCAG22/Understanding/dragging-movements.html). + +WCAG 2.2 Make sure users can easily reuse a previously uploaded file within a single journey, unless doing so would be a major security concern. + +For example, a user might need to upload a photo of their driving licence to prove their identity, and again to prove their address. + +You can make it easier for the user to reuse a file by showing it as an option for the user to select instead of the file upload. Consider users on public devices before choosing to make the file available to preview or download. This is to comply with WCAG 2.2 success criterion [3.3.7 Redundant Entry](https://www.w3.org/WAI/WCAG22/Understanding/redundant-entry.html). + There are 2 ways to use the file upload component. You can use HTML or, if you’re using [Nunjucks](https://mozilla.github.io/nunjucks/) or the [GOV.UK Prototype Kit](https://prototype-kit.service.gov.uk), you can use the Nunjucks macro. {{ example({ group: "components", item: "file-upload", example: "default", html: true, nunjucks: true, open: false, titleSuffix: "second" }) }} diff --git a/src/components/footer/index.md b/src/components/footer/index.md index 1e8a851036..4d0f8ee206 100644 --- a/src/components/footer/index.md +++ b/src/components/footer/index.md @@ -8,6 +8,7 @@ layout: layout-pane.njk --- {% from "_example.njk" import example %} +{% from "govuk/components/tag/macro.njk" import govukTag %} The footer provides copyright, licensing and other information about your service. @@ -42,9 +43,12 @@ You can add links to: - [cookies page](/patterns/cookies-page/) - terms and conditions - other language options +- help content Use ‘Privacy’, ‘Accessibility’, ‘Cookies’ and ‘Terms and conditions’ for the link text. +WCAG 2.2 If you include links to ‘help’ pages within a footer, make sure to place those links consistently within the footer content. Also make sure that ‘help’ links always function in a similar way across each page. This is to comply with WCAG 2.2 success criterion [3.2.6 Consistent Help](https://www.w3.org/WAI/WCAG22/Understanding/consistent-help.html). + ## Adding secondary navigation Only add secondary GOV.UK navigation if you’re creating a GOV.UK service, and you want users to be able to navigate away from the service to somewhere else on the GOV.UK website. For example, you probably don’t want to encourage a user to navigate away from a linear, form-type service. diff --git a/src/components/header/index.md b/src/components/header/index.md index 532b26b7b3..4254d8d27d 100644 --- a/src/components/header/index.md +++ b/src/components/header/index.md @@ -7,6 +7,7 @@ layout: layout-pane.njk --- {% from "_example.njk" import example %} +{% from "govuk/components/tag/macro.njk" import govukTag %} The GOV.UK header shows users that they are on GOV.UK and which service they are using. @@ -44,4 +45,14 @@ Use the header with a service name if your service is more than 5 pages long - t Use the header with navigation if you need to include basic navigation, contact or account management links. -{{ example({ group: "components", item: "header", example: "with-service-name-and-navigation", html: true, nunjucks: true, open: false, size: "s" }) }} +WCAG 2.2 Do not make header elements, like dropdown menus, ‘sticky’ to the top of the page by using `position: fixed` or any other method. In other words, avoid any implementations that cause menus to sit on top of page content. + +This is to make sure it does not hide or obscure any content which has a focus applied and comply with WCAG 2.2 success criterion [2.4.11 Focus not Obscured (minimum)](https://www.w3.org/WAI/WCAG22/Understanding/focus-not-obscured-minimum.html). + +In November 2021, [the GOV.UK homepage introduced a menu bar](https://insidegovuk.blog.gov.uk/2021/11/11/launching-gov-uks-new-menu-bar/) that avoids obscuring content by shifting the page down. + +{{ example({group: "components", item: "header", example: "with-service-name-and-navigation", html: true, nunjucks: true, open: false, size: "s"}) }} + +WCAG 2.2 You can add a link to a ‘help’ page in your service’s header. If you do, the link must be positioned consistently within the header, and must always link to the same place. + +For example, a header link to “Get help with this service” must go to the same place as similar header links elsewhere in your service. This is to comply with WCAG 2.2 success criterion [3.2.6 Consistent Help](https://www.w3.org/WAI/WCAG22/Understanding/consistent-help.html). diff --git a/src/components/panel/index.md b/src/components/panel/index.md index 81a7cbb6eb..9a6c85ea1f 100644 --- a/src/components/panel/index.md +++ b/src/components/panel/index.md @@ -8,6 +8,7 @@ layout: layout-pane.njk --- {% from "_example.njk" import example %} +{% from "govuk/components/tag/macro.njk" import govukTag %} The panel component is a visible container used on confirmation or results pages to highlight important content. @@ -36,3 +37,13 @@ Keep your panel text brief, as it's only meant for a high-level explanation of w Aim to use short words and phrases to make sure highlighted information is easy to read at different screen sizes. For example, shorter amounts of information is less likely to wrap around the panel, which can happen when using the zoom function on mobiles. If you need to give detailed information, or more context, use the description text under the heading text. + +### Selecting and copying information + +WCAG 2.2 Allow users to select and copy text within a [confirmation page](patterns/confirmation-page/) as well as its panel component. For example, users should be able to select and copy a booking number. This relates to WCAG 2.2 success criterion [3.3.7 Redundant Entry](https://www.w3.org/WAI/WCAG22/Understanding/redundant-entry.html). + +Consider offering an option for the user to copy information in the panel component area into their device’s clipboard if there’s information that the user is expected: + +- save +- remember +- copy diff --git a/src/components/phase-banner/index.md b/src/components/phase-banner/index.md index a997a44c77..1cb1c18c55 100644 --- a/src/components/phase-banner/index.md +++ b/src/components/phase-banner/index.md @@ -8,6 +8,7 @@ layout: layout-pane.njk --- {% from "_example.njk" import example %} +{% from "govuk/components/tag/macro.njk" import govukTag %} Use the phase banner component to show users your service is still being worked on. @@ -23,6 +24,8 @@ Use an alpha banner when your service is in alpha, and a beta banner if your ser Your banner must be directly under the black GOV.UK header and colour bar. +WCAG 2.2 Do not make the phase banner ‘sticky’ to the top of the page by using `position: fixed` or any other method. This is to make sure it does not cover or obscure any content which has a focus applied. This is to comply with WCAG 2.2 success criterion [2.4.11 Focus not Obscured (minimum)](https://www.w3.org/WAI/WCAG22/Understanding/focus-not-obscured-minimum.html). + There are 2 ways to use the phase banner component. You can use HTML or, if you are using [Nunjucks](https://mozilla.github.io/nunjucks/) or the [GOV.UK Prototype Kit](https://prototype-kit.service.gov.uk), you can use the Nunjucks macro. {{ example({ group: "components", item: "phase-banner", example: "default", html: true, nunjucks: true, open: false, titleSuffix: "second" }) }} diff --git a/src/components/select/index.md b/src/components/select/index.md index 68a95c52e9..bc261053b8 100644 --- a/src/components/select/index.md +++ b/src/components/select/index.md @@ -8,6 +8,7 @@ layout: layout-pane.njk --- {% from "_example.njk" import example %} +{% from "govuk/components/tag/macro.njk" import govukTag %} {{ example({ group: "components", item: "select", example: "default", html: true, nunjucks: true, open: false, loading: "eager" }) }} @@ -45,6 +46,12 @@ Style error messages as shown in the example: {{ example({ group: "components", item: "select", example: "error", html: true, nunjucks: true, open: false }) }} +### Avoid adding functionality to allow selecting multiple options + +The select component does not support selecting multiple options, [as there’s a history of poor usability and assistive technology support for `