Skip to content
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

Update accessibility docs #2039

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

gabalafou
Copy link
Collaborator

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.

Copy link

Coverage report

This PR does not seem to contain any modification to coverable code.

Copy link
Collaborator Author

@gabalafou gabalafou left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

self review

Comment on lines +32 to +40
- We also re-defined our `primary` and `secondary` colors to be more accessible
and distinct from semantic colors used to denote success, warning, info, and
danger contexts or information.
- We simplified the color palette and removed some colors that were problematic
in meeting WCAG 2 AA or AAA contrast requirements and for certain types of
colorblindness.
- We have improved how we assign text colors to interactive elements such as
buttons and dropdowns to ensure that they meet WCAG 2 AA or AAA contrast
requirements.
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just text wrapping

Comment on lines +3 to +12
Creating and publishing content that does not exclude disabled users is a
complex and iterative task.

While there is no one-size-fits-all solution to maintaining accessible content,
the PyData Sphinx Theme and this documentation site use some techniques to avoid common content shortcomings.
the PyData Sphinx Theme and this documentation site use some techniques to avoid
common content shortcomings.

:::{note}
Issues and pull requests to identify or fix accessibility issues on this theme or site are heartily welcomed!
Issues and pull requests to identify or fix accessibility issues on this theme
or site are heartily welcomed!
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just text wrapping

Comment on lines -14 to -18
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).
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unless somebody says not to, I am going to create a follow-up PR to remove the Lighthouse checks and configuration.

Comment on lines +69 to +71
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.
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just text wrapping

sitemap_url_scheme = "{link}"
html_baseurl = os.environ.get("SPHINX_HTML_BASE_URL", "http://127.0.0.1:8000/")
sitemap_locales = [None]
sitemap_url_scheme = "{link}"
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

removed indentation, any reason not to?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment on lines -100 to -102
"text": "PyData Theme",
"image_dark": "_static/logo-dark.svg",
"alt_text": "PyData Theme home",
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This example is misleading because our code now sets alt="" if a theme adopter sets the logo["text"] field. This is to avoid hearing the same text repeated twice by the screen reader, for example: "PyData Theme home PyData Theme".

I created what I think is a more realistic example based on the assumption that most sites will only put their logo in the top left and not the project text.

I guess I should add a note explaining that only one of text or alt_text should be specified; only rarely should both be specified together.

I'm thinking the need for this much nuance also suggests that we should simplify the config somehow.


[tota11y](https://khan.github.io/tota11y/#Installation) is an open source
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tota11y is no longer maintained. A note I found somewhere explains that the maintainers no longer saw the point, given how the improvement in the ecosystem of browser dev tools and other accessibility extensions.

Comment on lines +142 to +145
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.
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here is just text wrapping

Comment on lines -138 to -140
however, be aware that they do not follow accessibility best practices for
native button components such as using the correct `ARIA attributes
<https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Roles/button_role>`__.
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I felt that this did not help the theme adopter because it did not make a recommendation nor was the info helpful enough for a non-accessibility expert to make a judgment call, so I updated it with a specific recommendation (to use sparingly) and a specific example (about how the space bar doesn't work on links that look like buttons).

drammock
drammock previously approved these changes Nov 14, 2024
docs/community/topics/accessibility.md Outdated Show resolved Hide resolved
sitemap_url_scheme = "{link}"
html_baseurl = os.environ.get("SPHINX_HTML_BASE_URL", "http://127.0.0.1:8000/")
sitemap_locales = [None]
sitemap_url_scheme = "{link}"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@gabalafou
Copy link
Collaborator Author

Thanks for reviewing @drammock ☺️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants