-
Notifications
You must be signed in to change notification settings - Fork 321
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
131 additions
and
76 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,58 @@ | ||
# Accessibility checks | ||
# Accessibility checks and manual auditing | ||
|
||
```{note} | ||
April-2023: we are currently | ||
[re-evaluating how we do accessibility checks](https://github.com/pydata/pydata-sphinx-theme/issues/1168) | ||
and reporting, so this may change soon. | ||
As part of our commitment to making this theme accessible, we run automated | ||
checks against all of the pages under [](../../examples/kitchen-sink/index.rst). | ||
|
||
The accessibility check is run every time that a pull request is created on | ||
GitHub. We forbid merging a pull request into the codebase if it breaks this | ||
check. | ||
|
||
## Running the checks locally | ||
|
||
If you are [developing the theme locally](../setup.md), the simplest way to run | ||
the accessibility checks on your computer is: | ||
|
||
```sh | ||
tox run -m a11y | ||
``` | ||
|
||
In general, accessibility-checking tools can find a limited number of common HTML patterns that assistive technology | ||
can't help users understand. | ||
## Technical details | ||
|
||
The main two technologies we use to write and run accessibility checks are | ||
[Playwright for Python](https://playwright.dev/python/) and | ||
[axe-core](https://github.com/dequelabs/axe-core). | ||
|
||
Playwright is the successor to a similar library called Puppeteer. It provides a | ||
way to programmatically script a web browser to open, operate, inspect, and test | ||
web pages. Axe-core is a suite of accessibility checks written as a JavaScript | ||
program. The program is meant to be injected into a web page. Once injected, it | ||
examines the page for common accessibility failures, such as low contrast text. | ||
Our accessibility test suite uses Playwright to inject Axe-core into each of the | ||
Kitchen Sink pages plus a few other key pages in this documentation. We also | ||
wrote a few other Playwright scripts to ensure that certain theme components can | ||
be accessed using only the keyboard. All of our tests currently live in a file | ||
called | ||
[test_a11y.py](https://github.com/pydata/pydata-sphinx-theme/blob/main/tests/test_a11y.py). | ||
We would love contributions that add more accessibility checks to our test | ||
suite. | ||
|
||
## Accessibility checks as part of our development process | ||
We have also made these tests part of our continuous integration process, so | ||
that they are run in the cloud before we merge in new changes to the theme. We | ||
use GitHub Actions to provision machines in the cloud. We use Tox to install the | ||
needed dependencies on those machines. We use Pytest with the plug-in for | ||
Playwright to run the tests. Look for the string "accessibility" in the file | ||
[CI.yml](https://github.com/pydata/pydata-sphinx-theme/blob/main/.github/workflows/CI.yml) | ||
to find how we have configured GitHub Actions. | ||
|
||
We run a [Lighthouse](https://developers.google.com/web/tools/lighthouse) job in our CI/CD, which generates a "score" for all pages in our **Kitchen Sink** example documentation. | ||
The configuration for Lighthouse can be found in the `.github/workflows/lighthouserc.json` file. | ||
## Known limitations and manual auditing | ||
|
||
For more information about configuring Lighthouse, see [the Lighthouse documentation](https://github.com/GoogleChrome/lighthouse-ci/blob/main/docs/configuration.md). | ||
For more information about Accessibility in general, see [](../../user_guide/accessibility.md). | ||
We are well aware that automated checks fall far short of comprehensive | ||
accessibility auditing and testing, so we also conducted an accessibility audit | ||
of three pages from the theme docs. We collected those findings in an issue on | ||
GitHub, [May 2024 PyData Theme audit | ||
findings](https://github.com/Quansight-Labs/czi-scientific-python-mgmt/issues/72) | ||
|
||
We have also recently added automated tests using [Playwright](https://playwright.dev/python/) and [axe-core](https://github.com/dequelabs/axe-core) to improve our accessibility testing and reporting. | ||
Nearly all of the issues have been fixed, but of course things do break / have | ||
already broken, and some things may have never been discovered, so please | ||
[create an issue](https://github.com/pydata/pydata-sphinx-theme/issues/new) on | ||
GitHub if you find something broken. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters