-
Notifications
You must be signed in to change notification settings - Fork 24
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
Feat/wcag-checklist2194: added new wcag page #2202
base: master
Are you sure you want to change the base?
Changes from all commits
dd1b5fb
a56069b
7b33beb
3a299bf
f817d7a
c640fe3
d5ec326
e5cf17e
958c724
a7ead3e
8def1f5
fe0e72f
cbf8310
bfc8ecc
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
import React, { useContext, useState } from 'react'; | ||
import PropTypes from 'prop-types'; | ||
import { FormDown, FormUp } from 'grommet-icons'; | ||
import { | ||
AnnounceContext, | ||
Anchor, | ||
Box, | ||
CheckBox, | ||
CheckBoxGroup, | ||
Paragraph, | ||
ResponsiveContext, | ||
Text, | ||
} from 'grommet'; | ||
|
||
export const Checklist = ({ optionsObjects }) => ( | ||
<CheckBoxGroup options={optionsObjects}> | ||
{(option, { checked }) => { | ||
const [expanded, setExpanded] = useState(false); | ||
|
||
const setChecked = (value) => checked === value; | ||
const announce = useContext(AnnounceContext); | ||
const size = useContext(ResponsiveContext); | ||
Comment on lines
+21
to
+22
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I like that you are experimenting with each of these. |
||
|
||
const Icon = expanded ? FormUp : FormDown; | ||
|
||
return ( | ||
<Box direction="row"> | ||
<Box direction="row" gap="medium" pad="xsmall"> | ||
<CheckBox checked={checked} onChange={() => setChecked(false)} /> | ||
<Icon | ||
onClick={() => { | ||
announce('Expanded content'); | ||
setExpanded(!expanded); | ||
}} | ||
size="medium" | ||
/> | ||
</Box> | ||
<Box direction="row"> | ||
<Box | ||
onClick={() => { | ||
announce('Expanded content'); | ||
setExpanded(!expanded); | ||
}} | ||
focusIndicator={false} | ||
pad={ | ||
size === 'small' | ||
? { vertical: 'large' } | ||
: { vertical: 'xsmall' } | ||
} | ||
> | ||
<Text size="large" weight="bold"> | ||
{option.value} | ||
</Text> | ||
{expanded && ( | ||
<> | ||
<Paragraph>{option.description}</Paragraph> | ||
<Anchor | ||
label={`See Success Criterion ${option.number}`} | ||
target="_blank" | ||
href={option.link} | ||
/> | ||
</> | ||
)} | ||
</Box> | ||
</Box> | ||
</Box> | ||
); | ||
}} | ||
</CheckBoxGroup> | ||
); | ||
|
||
Checklist.propTypes = { | ||
optionsOjects: PropTypes.array, | ||
}; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export * from './Checklist'; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
import { Sort } from 'grommet-icons'; | ||
|
||
export const foundation = [ | ||
{ | ||
name: 'Accessibility', | ||
|
@@ -40,6 +42,25 @@ export const foundation = [ | |
'colorblind', | ||
'testing tools', | ||
], | ||
relatedContent: ['WCAG Checklist'], | ||
}, | ||
{ | ||
name: 'WCAG Checklist', | ||
category: 'Philosophy', | ||
cardOrder: 3, | ||
description: `A checklist for ensuring a product's accessibility is up | ||
to WCAG 2.1 standards.`, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can we link to WCAG 2.1 here? |
||
preview: { | ||
component: () => <Sort size='xlarge' color='text-strong' />, | ||
}, | ||
seoDescription: `A checklist for ensuring a product's accessibility is up | ||
to WCAG 2.1 standards.`, | ||
tags: [ | ||
'accessibility', | ||
'accessibility resources', | ||
'WCAG', | ||
], | ||
relatedContent: ['Accessibility'], | ||
}, | ||
{ | ||
name: 'Our Brand', | ||
|
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
@@ -1,8 +1,8 @@ | ||||||
import { | ||||||
CorePrinciples, | ||||||
GuideSection, | ||||||
VideoSection | ||||||
} from '../../examples/foundation'; | ||||||
import { CorePrinciples, GuideSection, VideoSection } from '../../examples/foundation'; | ||||||
import { getPageDetails, getRelatedContent, nameToPath } from '../../utils'; | ||||||
import { CardGrid } from '../../components'; | ||||||
|
||||||
export const wcagChecklistCard = [getPageDetails('WCAG Checklist')]; | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why is this being exported here? Where is it being consumed other than this file? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This seems like it should be placed in There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Using |
||||||
|
||||||
At HPE, we believe in being a force for good. We solve for humanity with humanity. We use technology to make the world better. We are unconditionally inclusive. **We believe that being accessible is a requirement, not an option**. | ||||||
|
||||||
|
@@ -13,7 +13,7 @@ Everyone has the right to fully access and take advantage of the web. Web access | |||||
|
||||||
Creating accessible applications means providing experiences that are easily usable by those who rely on keyboard navigation or screen readers, who are colorblind, or who are experiencing some other permanent, temporary, or situational disability. | ||||||
|
||||||
Accessibility covers a spectrum of disabilities, including but not restricted to blindness, low vision, hearing and cognitive impairments and situational disabilities. From using glasses to aid with sight to a temporary broken bone to carpal tunnel, [about 25% of the United States population](https://www.cdc.gov/ncbddd/disabilityandhealth/infographic-disability-impacts-all.html) lives with some type of disability, permanent or not. | ||||||
Accessibility covers a spectrum of disabilities, including but not restricted to blindness, low vision, hearing and cognitive impairments and situational disabilities. From using glasses to aid with sight to a temporary broken bone to carpal tunnel, [about 25% of the United States population](https://www.cdc.gov/ncbddd/disabilityandhealth/infographic-disability-impacts-all.html) and [over 1 billion people worldwide](https://www.who.int/en/news-room/fact-sheets/detail/disability-and-health) live with some type of disability, permanent or not. | ||||||
|
||||||
## Built into all Design System tools | ||||||
|
||||||
|
@@ -55,6 +55,12 @@ While supplemental attributes may need to be implemented and accessibility testi | |||||
|
||||||
For guidance on setting up your development environment, see [Developer Guidance](/foundation/developer-guidance). | ||||||
|
||||||
## Web Content Accessibility Guidelines (WCAG) Checklist | ||||||
|
||||||
The following checklist is a resource for researchers, designers and developers to use to check their product's accessibility. It uses the Web Content Accessibility Guidelines (WCAG) 2.1 as a reference point, as the WCAG is a shared accessibility standard for individuals, organizations and governments worldwide. | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This seems like we can edit this back and lean on the WCAG Checklist page to do the explaining.
Suggested change
|
||||||
|
||||||
<CardGrid cards={wcagChecklistCard} /> | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This seems like it should be placed in |
||||||
|
||||||
## Testing for Accessibility | ||||||
|
||||||
The following are actions you can incorporate into your workflow to better test and ensure accessibility across the board: | ||||||
|
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
@@ -0,0 +1,85 @@ | ||||||
import { Checklist } from '../../components'; | ||||||
|
||||||
There are three levels of compliance in the Web Content Accessibility Guidelines (WCAG) which reflect the priority of support: | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think we should pull up the HPE requirement, mentioning it earlier.
Suggested change
|
||||||
|
||||||
1. **A: Essential** | ||||||
- If this is not met, assistive technologies will not be able to aid in reading, understanding or operating the page or product. | ||||||
Comment on lines
+5
to
+6
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The formatting of this list has a lot going on with the numbering, A-level and sub-bullets. This might be a candidate to move to a component implementation. |
||||||
2. **AA: Ideal Support** | ||||||
- Required for multiple government and public websites. HPE strives for Level A and AA coverage on all products. | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
3. **AAA: Specialized Support** | ||||||
- Usually reserved for websites and applications that serve a specialized audience. | ||||||
|
||||||
### Success Criteria | ||||||
|
||||||
Each item on the checklist refers to a specific, testable success criterion within the WCAG 2.1 described by a reference number and title. Some accessibility issues align with multiple rules. In these cases, the most relevant criterion is identified for the checklist item. | ||||||
|
||||||
### Does this checklist guarantee a product is fully accessible? | ||||||
|
||||||
No. There is no such thing as a "100%" accessible product. However, this checklist prompts designers and developers to check for coverage of a wide range of disability conditions. Addressing these issues will improve experiences for all users who access your product and increase overall accessibility. | ||||||
|
||||||
## Global Code | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I am not familiar with the term "global code" in this context. I was expecting this to be labeled something like "Checklist". There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This entire page is serving as the checklist with a brief introduction and the main headers being the sections the checklist will be divided into. I wasn't sure about having another header on the page be "Checklist" if the entire page serves as the checklist. I think we will need a table of contents moving forward as it gets longer also since there will be a lot of sections. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Mentioned this below, but it'd be nice to see the overall content outline for this page (sans detail). This will help with content hierarchy, headings and such. |
||||||
|
||||||
Global code affects an entire website or product application. | ||||||
|
||||||
export const globalCodeOptionsObjects = [ | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We should place this in the |
||||||
{ | ||||||
value: 'Validate your HTML by avoiding significant parsing errors.', | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What are we using for reference to create this list? Can you share where you are sourcing / getting inspiration from? The presentation order seems a bit jumbled and isn't flowing for me. Can we group / order in a more intuitive manner? I am having trouble following. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Here is the inspiration: https://www.a11yproject.com/checklist/ For this section in particular, I am taking from their grouping of items that relate to "global code" or the code that affects the entire page or product. These are usually easy and fast things to check first for overall functionality. Ensuring these things are in order would be a good first pass at the accessibility of the site. Moving forward, the next sections will continue to draw inspiration from this checklist but I am cross referencing with more checklists that I have looked into to determine the best way to break up the WCAG:
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'd be interested in seeing the bullet-pointed "outline" of the checklist to get a sense of the vision. It doesn't (nor shouldn't) have all the detail at this stage, rather it serves as a roadmap for what this checklist might look like. |
||||||
description: | ||||||
'Validating your HTML helps to provide a consistent, expected experience across all browsers and assistive technologies.', | ||||||
link: 'https://www.w3.org/WAI/WCAG21/Understanding/parsing', | ||||||
number: '4.1.1: Parsing', | ||||||
}, | ||||||
{ | ||||||
value: 'Use a lang attribute on the <html> element.', | ||||||
description: | ||||||
'This allows assistive technologies such as screen readers to pronounce content correctly.', | ||||||
link: 'https://www.w3.org/WAI/WCAG21/Understanding/language-of-page', | ||||||
number: '3.1.1: Language of Page', | ||||||
}, | ||||||
{ | ||||||
value: | ||||||
'Provide a descriptive and informative <title> element for each page.', | ||||||
description: | ||||||
"The <title> element, found in the document's head element, is most often the first information announced by assistive technologies. A specific and helpful <title> element will help users find content and orient themselves within it to begin navigating on the page.", | ||||||
link: 'https://www.w3.org/WAI/WCAG21/Understanding/page-titled', | ||||||
number: '2.4.2: Page Title', | ||||||
}, | ||||||
{ | ||||||
value: 'Ensure that viewport zoom is not disabled.', | ||||||
description: | ||||||
'Visually rendered text, including text-based controls, should be scalable by the user, so that they can best see and read content.', | ||||||
link: 'https://www.w3.org/WAI/WCAG21/Understanding/resize-text', | ||||||
number: '1.4.4: Resize Text', | ||||||
}, | ||||||
{ | ||||||
value: | ||||||
'Use landmark elements to help identify significant content regions of a page.', | ||||||
description: | ||||||
"Landmark regions help communicate the layout and important areas of a page. Identifying them correctly can help users quickly access these regions. For example, use the <nav> element to wrap a page's navigation and the <main> element for the page's primary content.", | ||||||
link: 'https://www.w3.org/WAI/WCAG21/Understanding/name-role-value', | ||||||
number: '4.1.2: Name, Role, Value', | ||||||
}, | ||||||
{ | ||||||
value: 'Ensure content can be navigated in a linear flow.', | ||||||
description: | ||||||
'When users navigate sequentially through content, they should encounter information in an order that is consistent with the meaning of the page. Remove tabindex attribute values that are not either 0 or -1. Elements that are inherently focusable, such as links or button elements, do not require a tabindex. Elements that are not inherently focusable should not have a tabindex.', | ||||||
link: 'https://www.w3.org/WAI/WCAG21/Understanding/focus-order', | ||||||
number: '2.4.3: Focus Order', | ||||||
}, | ||||||
{ | ||||||
value: 'Avoid use of the autofocus attribute.', | ||||||
description: | ||||||
'People who use assistive technologies may be confused or disoriented when focus is moved without action on their end. Using autofocus may also cause extra work for users to navigate out of the focused area and to other parts of the page.', | ||||||
link: 'https://www.w3.org/WAI/WCAG21/Understanding/focus-order', | ||||||
number: '2.4.3: Focus Order', | ||||||
}, | ||||||
{ | ||||||
value: 'Allow users to extend session timeouts.', | ||||||
description: | ||||||
'Users need to be given an adequate amount of time to interact with the content of a page. If web functions are time-dependent, users will be unable to perform certain actions. If you cannot remove session timeouts altogether, then allow for users to easily adjust or turn off their session before it ends.', | ||||||
link: 'https://www.w3.org/WAI/WCAG21/Understanding/timing-adjustable', | ||||||
number: '2.2.1', | ||||||
}, | ||||||
]; | ||||||
|
||||||
<Checklist optionsObjects={globalCodeOptionsObjects} /> |
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.
Do you have designs you are referencing for this checklist implementation? This feels like a pattern I haven't seen before and I have the following reactions:
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.
The design pattern came mostly from the checklist that I took inspiration from: https://www.a11yproject.com/checklist/ which has a show/collapse for more information and a link to the success criterion. I think we could work with not having the show/collapse and instead just having a list of checkboxes with a title, description and url. Wanted to get some initial feedback on this pattern before moving forward.
The screen reader experience was one that I am still working with, as I made note of the way the screen reader is reading aloud the icons and not allowing the check/uncheck behavior.