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
docs: updated accessibility section #4161
base: main
Are you sure you want to change the base?
Conversation
Tachometer resultsChromeaccordion permalinkbasic-test
Firefoxaccordion permalinkbasic-test
|
Lighthouse scores
What is this?Lighthouse scores comparing the documentation site built from the PR ("Branch") to that of the production documentation site ("Latest") and the build currently on Transfer Size
Request Count
|
I really like how this looks, but I know sure what specifically it adds to the docs site for it to be the same on every page. The component link almost always links to the top of the page you're already looking at at I'm not sure how the GitHub repo is relavant to an accessibility report. If we're just using this statically would it be better to make a single page with a little more content that outlines that those test are or so? That would also give us a place to link the content here to: |
const hasReadmeinPackages = fs.existsSync( | ||
path.resolve(__dirname, '../../../packages', packageName, 'README.md') | ||
); |
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.
What does this state mean to you? Also, when would a README.md
not exist?
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.
Should be simplified now with isComponent value. This was experimental to check inside the package directory. I found isComponent already does this.
@@ -15,6 +15,9 @@ layout: layout.njk | |||
{% for part in collections[componentName] %} | |||
<sp-tab-panel class="section" value="{{ part.data.partType }}"> | |||
{{ part.templateContent | safe }} | |||
{% if hasReadmePackagesTemplate %} |
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 will place this content at the bottom of the Examples AND the API Table which is what is causing duplicate IDs in the same DOM tree and causing the Tooltips not to open in the Examples tab.
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 logic has been changed to add inside the for loop within the tab panel
{% for part in collections[componentName] %}
<sp-tab-panel class="section" value="{{ part.data.partType }}">
{{ part.templateContent | safe }}
{% if isComponentTemplate and part.data.partType === 'examples' %}
{% include "partials/accessibility.njk" %}
{% endif %}
</sp-tab-panel>
{% endfor %}
<sp-table-cell><sp-link href="https://opensource.adobe.com/spectrum-web-components/components/{{componentName}}/#usage">{{componentName}}</sp-link></sp-table-cell> | ||
<sp-table-cell> | ||
<span id="defaulttest">Default state</span> | ||
<sp-overlay trigger="defaulttest@hover" placement="bottom"> |
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.
We're still working on #3596 but, the accessibility here with a screen reader should be more like https://enhancement-docs-accessibility--spectrum-web-components.netlify.app/components/overlay/#example than it is now. I'm not sure if that's the lack of tab indexes on the triggers, or the duplicate IDs, or type="auto"
when it should be type="hint"
, or something else, but please take a closer look to ensure we've at least prepared this content to the best of the capabilities of the elements we're using.
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.
I checked and the accessibility is not there for badge component which in turn renders a label. So I have updated each element inside this table to render as a button to leverage the accessibility implementations of a button and tested it in screen reader. Please note this is a screen reader test. The UI has been updated accordingly.
@@ -19,6 +19,9 @@ layout: layout.njk | |||
{% endfor %} | |||
</sp-tabs> | |||
</main> | |||
{% if isComponentTemplate %} |
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.
Slightly better positioning, but it still displays on both tabs, is that intended? It's also outside of the <main>
element which means it's in a weird part of the document, semantically.
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 has been changed to a more controlled logic.
<sp-badge variant="positive" id="trigger-1"> | ||
Tested | ||
</sp-badge> | ||
<sp-overlay trigger="trigger-1@hover" placement="bottom"> |
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.
I'm seeing this work with a pointing device, but still not seeing this relationship managed in a screen reader.
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.
True since this is being triggered from an unaccessible component i.e badge
which needs to be set an aria-label
… into enhancement/docs-accessibility
<sp-table-cell> | ||
<sp-button static="white" style="--mod-bold-font-weight:400">Default state</sp-button> | ||
</sp-table-cell> |
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.
We shouldn't use a button for static cell content. Also, static="white"
is meant to render a button over a dark colored background, so that the border and focus ring will be white. Using it in this case makes the border and focus ring render as white on white, which makes it impossible to track focus.
<sp-table-cell> | |
<sp-button static="white" style="--mod-bold-font-weight:400">Default state</sp-button> | |
</sp-table-cell> | |
<sp-table-cell> | |
Default state | |
</sp-table-cell> |
<sp-table quiet style="--mod-table-row-background-color-hover: none"> | ||
<sp-table-head> | ||
<sp-table-head-cell>Component</sp-table-head-cell> | ||
<sp-table-head-cell>Accessibility test</sp-table-head-cell> | ||
<sp-table-head-cell>Accessibility Contract</sp-table-head-cell> | ||
<sp-table-head-cell>Status</sp-table-head-cell> | ||
</sp-table-head> | ||
<sp-table-body> | ||
<sp-table-row value="row1"> | ||
<sp-table-cell><sp-link href="https://opensource.adobe.com/spectrum-web-components/components/{{componentName}}/#usage">{{componentName}}</sp-link></sp-table-cell> | ||
<sp-table-cell> | ||
<sp-button static="white" style="--mod-bold-font-weight:400">Default state</sp-button> | ||
</sp-table-cell> | ||
<sp-table-cell> | ||
<sp-button static="white" style="--mod-bold-font-weight:400">Test(s) that ensure the initial render state of a component is accessible.</sp-button></sp-table-cell> | ||
<sp-table-cell> | ||
<sp-button id="trigger-1" variant="secondary" style="--mod-button-background-color-default: #a7f0ba;">Tested</sp-button> | ||
<sp-overlay trigger="trigger-1@hover" placement="bottom"> | ||
<sp-tooltip> | ||
Passes all automated tests with no reported accessibility violations. | ||
</sp-tooltip> | ||
</sp-overlay> | ||
</sp-table-cell> | ||
</sp-table-row> | ||
<sp-table-row value="row2"> | ||
<sp-table-cell></sp-table-cell> | ||
<sp-table-cell> | ||
<sp-button static="white" style="--mod-bold-font-weight:400">Advanced states</sp-button> | ||
</sp-table-cell> | ||
<sp-table-cell> | ||
<sp-button static="white" style="--mod-bold-font-weight:400">Tests that ensure additional states of the component are accessible. | ||
This could be interactive states of a component or its multiple variants.</sp-button> | ||
</sp-table-cell> | ||
<sp-table-cell> | ||
<sp-button id="trigger-2" variant="secondary" style="--mod-button-background-color-default: #a7f0ba;">Tested</sp-button> | ||
<sp-overlay trigger="trigger-2@hover" placement="bottom"> | ||
<sp-tooltip> | ||
Passes all automated tests with no reported accessibility violations. | ||
</sp-tooltip> | ||
</sp-overlay> | ||
</sp-table-cell> | ||
</sp-table-row> | ||
<sp-table-row value="row2"> | ||
<sp-table-cell></sp-table-cell> | ||
<sp-table-cell> | ||
<sp-button static="white" style="--mod-bold-font-weight:400">Keyboard navigation</sp-button> | ||
</sp-table-cell> | ||
<sp-table-cell> | ||
<sp-button static="white" style="--mod-bold-font-weight:400">Tests that ensure focus is properly managed, and all interactive functions of a | ||
component have a proper keyboard-accessible equivalent.</sp-button> | ||
</sp-table-cell> | ||
<sp-table-cell> | ||
<sp-button id="trigger-3" variant="secondary" style="--mod-button-background-color-default: #a7f0ba;">Tested</sp-button> | ||
<sp-overlay trigger="trigger-3@hover" placement="bottom"> | ||
<sp-tooltip> | ||
Passes all automated tests with no reported accessibility violations. | ||
</sp-tooltip> | ||
</sp-overlay> | ||
</sp-table-cell> | ||
</sp-table-row> | ||
<sp-table-row value="row3"> | ||
<sp-table-cell></sp-table-cell> | ||
<sp-table-cell> | ||
<sp-button static="white" style="--mod-bold-font-weight:400">Screen reader</sp-button> | ||
</sp-table-cell> | ||
<sp-table-cell> | ||
<sp-button static="white" style="--mod-bold-font-weight:400">This manual testing ensures that the visual information on the screen | ||
is properly conveyed and read correctly by screen readers such as JAWS, VoiceOver, and NVDA.</sp-button> | ||
</sp-table-cell> | ||
<sp-table-cell> | ||
<sp-button id="trigger-4" variant="secondary" style="--mod-button-background-color-default: #9ef0f0;">Manually Tested</sp-button> | ||
<sp-overlay trigger="trigger-4@hover" placement="bottom"> | ||
<sp-tooltip> | ||
A human has manually tested this component, e.g. screen reader testing. | ||
</sp-tooltip> | ||
</sp-overlay> | ||
</sp-table-cell> | ||
</sp-table-row> | ||
</sp-table-body> | ||
</sp-table> |
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.
<sp-table quiet style="--mod-table-row-background-color-hover: none"> | |
<sp-table-head> | |
<sp-table-head-cell>Component</sp-table-head-cell> | |
<sp-table-head-cell>Accessibility test</sp-table-head-cell> | |
<sp-table-head-cell>Accessibility Contract</sp-table-head-cell> | |
<sp-table-head-cell>Status</sp-table-head-cell> | |
</sp-table-head> | |
<sp-table-body> | |
<sp-table-row value="row1"> | |
<sp-table-cell><sp-link href="https://opensource.adobe.com/spectrum-web-components/components/{{componentName}}/#usage">{{componentName}}</sp-link></sp-table-cell> | |
<sp-table-cell> | |
<sp-button static="white" style="--mod-bold-font-weight:400">Default state</sp-button> | |
</sp-table-cell> | |
<sp-table-cell> | |
<sp-button static="white" style="--mod-bold-font-weight:400">Test(s) that ensure the initial render state of a component is accessible.</sp-button></sp-table-cell> | |
<sp-table-cell> | |
<sp-button id="trigger-1" variant="secondary" style="--mod-button-background-color-default: #a7f0ba;">Tested</sp-button> | |
<sp-overlay trigger="trigger-1@hover" placement="bottom"> | |
<sp-tooltip> | |
Passes all automated tests with no reported accessibility violations. | |
</sp-tooltip> | |
</sp-overlay> | |
</sp-table-cell> | |
</sp-table-row> | |
<sp-table-row value="row2"> | |
<sp-table-cell></sp-table-cell> | |
<sp-table-cell> | |
<sp-button static="white" style="--mod-bold-font-weight:400">Advanced states</sp-button> | |
</sp-table-cell> | |
<sp-table-cell> | |
<sp-button static="white" style="--mod-bold-font-weight:400">Tests that ensure additional states of the component are accessible. | |
This could be interactive states of a component or its multiple variants.</sp-button> | |
</sp-table-cell> | |
<sp-table-cell> | |
<sp-button id="trigger-2" variant="secondary" style="--mod-button-background-color-default: #a7f0ba;">Tested</sp-button> | |
<sp-overlay trigger="trigger-2@hover" placement="bottom"> | |
<sp-tooltip> | |
Passes all automated tests with no reported accessibility violations. | |
</sp-tooltip> | |
</sp-overlay> | |
</sp-table-cell> | |
</sp-table-row> | |
<sp-table-row value="row2"> | |
<sp-table-cell></sp-table-cell> | |
<sp-table-cell> | |
<sp-button static="white" style="--mod-bold-font-weight:400">Keyboard navigation</sp-button> | |
</sp-table-cell> | |
<sp-table-cell> | |
<sp-button static="white" style="--mod-bold-font-weight:400">Tests that ensure focus is properly managed, and all interactive functions of a | |
component have a proper keyboard-accessible equivalent.</sp-button> | |
</sp-table-cell> | |
<sp-table-cell> | |
<sp-button id="trigger-3" variant="secondary" style="--mod-button-background-color-default: #a7f0ba;">Tested</sp-button> | |
<sp-overlay trigger="trigger-3@hover" placement="bottom"> | |
<sp-tooltip> | |
Passes all automated tests with no reported accessibility violations. | |
</sp-tooltip> | |
</sp-overlay> | |
</sp-table-cell> | |
</sp-table-row> | |
<sp-table-row value="row3"> | |
<sp-table-cell></sp-table-cell> | |
<sp-table-cell> | |
<sp-button static="white" style="--mod-bold-font-weight:400">Screen reader</sp-button> | |
</sp-table-cell> | |
<sp-table-cell> | |
<sp-button static="white" style="--mod-bold-font-weight:400">This manual testing ensures that the visual information on the screen | |
is properly conveyed and read correctly by screen readers such as JAWS, VoiceOver, and NVDA.</sp-button> | |
</sp-table-cell> | |
<sp-table-cell> | |
<sp-button id="trigger-4" variant="secondary" style="--mod-button-background-color-default: #9ef0f0;">Manually Tested</sp-button> | |
<sp-overlay trigger="trigger-4@hover" placement="bottom"> | |
<sp-tooltip> | |
A human has manually tested this component, e.g. screen reader testing. | |
</sp-tooltip> | |
</sp-overlay> | |
</sp-table-cell> | |
</sp-table-row> | |
</sp-table-body> | |
</sp-table> | |
<sp-table role="table" quiet style="--mod-table-row-background-color-hover: none"> | |
<sp-table-head> | |
<sp-table-head-cell>Component</sp-table-head-cell> | |
<sp-table-head-cell>Accessibility test</sp-table-head-cell> | |
<sp-table-head-cell>Accessibility Contract</sp-table-head-cell> | |
<sp-table-head-cell>Status</sp-table-head-cell> | |
</sp-table-head> | |
<sp-table-body> | |
<sp-table-row value="row1"> | |
<sp-table-cell role="cell"><sp-link href="https://opensource.adobe.com/spectrum-web-components/components/{{componentName}}/#usage">{{componentName}}</sp-link></sp-table-cell> | |
<sp-table-cell role="rowheader"> | |
Default state | |
</sp-table-cell> | |
<sp-table-cell role="cell"> | |
Test(s) that ensure the initial render state of a component is accessible. | |
</sp-table-cell> | |
<sp-table-cell role="cell"> | |
<sp-button id="trigger-1" variant="secondary" style="--mod-button-background-color-default: #a7f0ba;">Tested</sp-button> | |
<sp-overlay trigger="trigger-1@hover" placement="bottom"> | |
<sp-tooltip> | |
Passes all automated tests with no reported accessibility violations. | |
</sp-tooltip> | |
</sp-overlay> | |
</sp-table-cell> | |
</sp-table-row> | |
<sp-table-row value="row2"> | |
<sp-table-cell role="cell"></sp-table-cell> | |
<sp-table-cell role="rowheader"> | |
Advanced states | |
</sp-table-cell> | |
<sp-table-cell role="cell"> | |
Tests that ensure additional states of the component are accessible. | |
This could be interactive states of a component or its multiple variants. | |
</sp-table-cell> | |
<sp-table-cell role="cell"> | |
<sp-button id="trigger-2" variant="secondary" style="--mod-button-background-color-default: #a7f0ba;">Tested</sp-button> | |
<sp-overlay trigger="trigger-2@hover" placement="bottom"> | |
<sp-tooltip> | |
Passes all automated tests with no reported accessibility violations. | |
</sp-tooltip> | |
</sp-overlay> | |
</sp-table-cell> | |
</sp-table-row> | |
<sp-table-row value="row2"> | |
<sp-table-cell role="cell"></sp-table-cell> | |
<sp-table-cell role="rowheader"> | |
Keyboard navigation | |
</sp-table-cell> | |
<sp-table-cell role="cell"> | |
Tests that ensure focus is properly managed, and all interactive functions of a | |
component have a proper keyboard-accessible equivalent. | |
</sp-table-cell> | |
<sp-table-cell role="cell"> | |
<sp-button id="trigger-3" variant="secondary" style="--mod-button-background-color-default: #a7f0ba;">Tested</sp-button> | |
<sp-overlay trigger="trigger-3@hover" placement="bottom"> | |
<sp-tooltip> | |
Passes all automated tests with no reported accessibility violations. | |
</sp-tooltip> | |
</sp-overlay> | |
</sp-table-cell> | |
</sp-table-row> | |
<sp-table-row value="row3"> | |
<sp-table-cell role="cell"></sp-table-cell> | |
<sp-table-cell role="rowheader"> | |
Screen reader | |
</sp-table-cell> | |
<sp-table-cell role="cell"> | |
This manual testing ensures that the visual information on the screen | |
is properly conveyed and read correctly by screen readers such as JAWS, VoiceOver, and NVDA. | |
</sp-table-cell> | |
<sp-table-cell role="cell"> | |
<sp-button id="trigger-4" variant="secondary" style="--mod-button-background-color-default: #9ef0f0;">Manually Tested</sp-button> | |
<sp-overlay trigger="trigger-4@hover" placement="bottom"> | |
<sp-tooltip> | |
A human has manually tested this component, e.g. screen reader testing. | |
</sp-tooltip> | |
</sp-overlay> | |
</sp-table-cell> | |
</sp-table-row> | |
</sp-table-body> | |
</sp-table> |
Description
Added Accessibility Testing status section to denote the contracts tested on different simulation before delivery.
Related issue(s)
Motivation and context
How has this been tested?
Screenshots (if appropriate)
Types of changes
Checklist
Best practices
This repository uses conventional commit syntax for each commit message; note that the GitHub UI does not use this by default so be cautious when accepting suggested changes. Avoid the "Update branch" button on the pull request and opt instead for rebasing your branch against
main
.