You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This pull request brings the accessibility docs up to date.
Some of the changes in this pull request involve hard-wrapping the text
in the docs files. I feel like this itself is an accessibility
improvement as long lines are harder to read. It's also makes text
diffing in git better.
---------
Co-authored-by: Daniel McCloy <[email protected]>
Co-authored-by: Tania Allard <[email protected]>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
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.
15
-
The configuration for Lighthouse can be found in the `.github/workflows/lighthouserc.json` file.
53
+
## Known limitations and manual auditing
16
54
17
-
For more information about configuring Lighthouse, see [the Lighthouse documentation](https://github.com/GoogleChrome/lighthouse-ci/blob/main/docs/configuration.md).
18
-
For more information about Accessibility in general, see [](../../user_guide/accessibility.md).
55
+
We are well aware that automated checks fall far short of comprehensive
56
+
accessibility auditing and testing, so we also conducted an accessibility audit
57
+
of three pages from the theme docs. We collected those findings in an issue on
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.
61
+
Nearly all of the issues have been fixed, but of course things do break / have
62
+
already broken, and some things may have never been discovered, so please
63
+
[create a GitHub issue](https://github.com/pydata/pydata-sphinx-theme/issues/new) if you find something inaccessible.
Creating and publishing content that does not exclude disabled users is a complex and iterative task.
3
+
Creating and publishing content that does not exclude disabled users is a
4
+
complex and iterative task.
4
5
5
6
While there is no one-size-fits-all solution to maintaining accessible content,
6
-
the PyData Sphinx Theme and this documentation site use some techniques to avoid common content shortcomings.
7
+
the PyData Sphinx Theme and this documentation site use some techniques to avoid
8
+
common content shortcomings.
7
9
8
10
:::{note}
9
-
Issues and pull requests to identify or fix accessibility issues on this theme or site are heartily welcomed!
11
+
Issues and pull requests to identify or fix accessibility issues on this theme
12
+
or site are heartily welcomed!
10
13
:::
11
14
12
15
## What We've Done
@@ -26,12 +29,15 @@ page that lacks metadata, please open a pull request to add it!
26
29
to choose from at https://github.com/Quansight-Labs/accessible-pygments.
27
30
- We recently revisited the PyData Sphinx theme color palette to ensure that
28
31
the colors we use meet WCAG 2 AA or AAA contrast requirements.
29
-
- We also re-defined our `primary` and `secondary` colors to be more accessible and distinct from semantic colors used
30
-
to denote success, warning, info, and danger contexts or information.
31
-
- We simplified the color palette and removed some colors that were problematic in meeting WCAG 2 AA or AAA contrast requirements
32
-
and for certain types of colorblindness.
33
-
- We have improved how we assign text colors to interactive elements such as buttons and dropdowns to ensure that they meet
34
-
WCAG 2 AA or AAA contrast requirements.
32
+
- We also re-defined our `primary` and `secondary` colors to be more accessible
33
+
and distinct from semantic colors used to denote success, warning, info, and
34
+
danger contexts or information.
35
+
- We simplified the color palette and removed some colors that were problematic
36
+
in meeting WCAG 2 AA or AAA contrast requirements and for certain types of
37
+
colorblindness.
38
+
- We have improved how we assign text colors to interactive elements such as
39
+
buttons and dropdowns to ensure that they meet WCAG 2 AA or AAA contrast
40
+
requirements.
35
41
36
42
### Keyboard Navigation Support
37
43
@@ -41,6 +47,11 @@ links and other interactive elements, we have worked to ensure they:
41
47
- Have a visible focus indicator (WCAG 2.4.7)
42
48
- Can be accessed via keyboard navigation (WCAG 2.1.1)
43
49
50
+
### Testing and auditing
51
+
52
+
We have also added automated tests and conducted manual audits. See
53
+
[](../community/topics/accessibility.md).
54
+
44
55
## What You Can Do
45
56
46
57
### Site configuration
@@ -55,10 +66,12 @@ specifying at least the baseline natural language will help assistive technology
55
66
identify if the content is in a language the reader understands.
56
67
57
68
:::{hint}
58
-
In your `conf.py` file, [specifying the language your docs are written in](https://www.sphinx-doc.org/en/master/usage/configuration.html#confval-language) will propagate to the top-level `HTML` tag.
69
+
In your `conf.py` file,
70
+
[specifying the language your docs are written in](https://www.sphinx-doc.org/en/master/usage/configuration.html#confval-language)
71
+
will propagate to the top-level `HTML` tag.
59
72
60
73
```python
61
-
language ="en"
74
+
language ="en"
62
75
```
63
76
64
77
:::
@@ -80,71 +93,67 @@ For a simple site (no extra languages or versions), ensure `sphinx-sitemap`
80
93
is installed in your documentation environment, and modify your `conf.py`:
and [Pa11y CI](https://github.com/pa11y/pa11y-ci).
141
146
142
-
#### Lighthouse
147
+
The [foo-software/lighthouse-check-action](https://github.com/foo-software/lighthouse-check-action)
148
+
may be helpful if the code for your site is hosted on GitHub.
143
149
144
-
[Lighthouse](https://developers.google.com/web/tools/lighthouse) provides an automated assessment of basic accessibility issues in addition to search engine
145
-
automation, page performance, and other best practices.
150
+
If you are curious about how we do accessibility CI for this theme, refer to the
If in your site's :ref:`custom CSS file <custom-css>` you override the :ref:`CSS custom properties <css-variables>` ``--pst-color-*`` (where ``*`` is one of the semantic color names, such as ``primary``, ``danger``), badges and buttons will automatically use the custom color.
135
+
<https://sphinx-design.readthedocs.io/en/latest/badges_buttons.html>`__ are
136
+
actually links, meaning they are rendered in HTML with ``<a>`` tags instead
137
+
of ``<button>``. Use them if you need a link to look like a button, but try
138
+
not to overuse them as they are not considered best practice for
139
+
accessibility. (For example, it upsets user interface expectations because
140
+
the space bar can be used on ``<button>``-tag buttons but not on ``<a>``-tag
141
+
links that look like buttons.)
142
+
143
+
If in your site's :ref:`custom CSS file <custom-css>` you override the :ref:`CSS
144
+
custom properties <css-variables>` ``--pst-color-*`` (where ``*`` is one of the
145
+
semantic color names, such as ``primary``, ``danger``), badges and buttons will
0 commit comments