Debian Codegraph @

docs/community/topics/accessibility.md

raw
1 # Accessibility checks and manual auditing
2
3 As part of our commitment to making this theme accessible, we run automated
4 checks against all the pages under [](../../examples/kitchen-sink/index.rst).
5
6 The accessibility check is run every time that a pull request is created on
7 GitHub. We forbid merging a pull request into the codebase if it breaks this
8 check.
9
10 ## Running the checks locally
11
12 If you are [developing the theme locally](../setup.md), the simplest way to run
13 the accessibility checks on your computer is:
14
15 ```sh
16 tox run -m a11y
17 ```
18
19 ## Technical details
20
21 The main two technologies we use to write and run accessibility checks are
22 [Playwright for Python](https://playwright.dev/python/) and
23 [axe-core](https://github.com/dequelabs/axe-core).
24
25 Playwright is the successor to a similar library called Puppeteer. It provides a
26 way to programmatically script a web browser to open, operate, inspect, and test
27 web pages. Axe-core is a suite of accessibility checks written as a JavaScript
28 program. The program is meant to be injected into a web page. Once injected, it
29 examines the page for common accessibility failures, such as low contrast text.
30 Our accessibility test suite uses Playwright to inject Axe-core into each of the
31 Kitchen Sink pages plus a few other key pages in this documentation. We also
32 wrote a few other Playwright scripts to ensure that certain theme components can
33 be accessed using only the keyboard. All of our tests currently live in a file
34 called
35 [test_a11y.py](https://github.com/pydata/pydata-sphinx-theme/blob/main/tests/test_a11y.py).
36 :::{note}
37 We would love contributions that add more accessibility checks to our test
38 suite.
39 :::
40
41 We have also made these tests part of our continuous integration process, so
42 they are run in the cloud before we merge in new changes to the theme. We
43 use the following tools:
44
45 - GitHub Actions to provision machines in the cloud
46 - `tox` to install the needed dependencies on those machines
47 - `pytest` with the Playwright plug-in to run the tests.
48
49 You can check out the [a11y.yml](https://github.com/pydata/pydata-sphinx-theme/blob/main/.github/workflows/a11y.yml)
50 file to find how we have configured GitHub Actions.
51
52 ## Known limitations and manual auditing
53
54 We are well aware that automated checks fall far short of comprehensive
55 accessibility auditing and testing, so we also conducted an accessibility audit
56 of three pages from the theme docs. We collected those findings in an issue on
57 GitHub, [May 2024 PyData Theme audit
58 findings](https://github.com/Quansight-Labs/czi-scientific-python-mgmt/issues/72)
59
60 Nearly all the issues have been fixed, but naturally things do break / have
61 already broken, and some things may have never been discovered, so please
62 [create a GitHub issue](https://github.com/pydata/pydata-sphinx-theme/issues) if you
63 find something inaccessible.