-
Notifications
You must be signed in to change notification settings - Fork 341
ENH - Update links styling #1353
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
Merged
Merged
Changes from 18 commits
Commits
Show all changes
32 commits
Select commit
Hold shift + click to select a range
2e88957
:wheelchair: Add basic links style
trallard a402717
Update link styles for sidebars
trallard 80b9022
♿️ Replace more links - sidebars and TOC
trallard 135ff52
:wheelchair: Add basic links style
trallard 47c7a63
Update link styles for sidebars
trallard a60a451
♿️ Replace more links - sidebars and TOC
trallard 923a050
Merge remote-tracking branch 'origin/trallard/underline-links' into t…
trallard f5fe71c
♿️ Update navigation links style
trallard ba0f4e6
Merge remote-tracking branch 'upstream/main' into trallard/underline-…
trallard b0ca32c
:memo: Update accessibility docs
trallard 77f3803
:wheelchair: Update more links styles
trallard 166d341
Update icon links style
trallard 9dc397c
Remove duplicate styles
trallard 45291b2
:lipstick: Update base link style
trallard 89cb4b3
:lipstick: Update navigation styles
trallard a852fb9
Apply suggestions from code review
trallard 635ebbf
Fix sidebar links - hover
trallard f5ea75e
:truck: Move helpers into separate files
trallard 6b81b73
:wheelchair: Ensure current styles are current and not active
trallard 388f5e5
:wheelchair: Ensure current links are consistent
trallard 2ce462d
:wheelchair: Fix TOC hover links
trallard bbe3857
:lipstick: Ensure prev-next are purple on hover
trallard ee47d05
Update active + hover style
trallard b2cacfa
:wheelchair: Fix hover on dropdowns
trallard 31ab41a
Unify link styles -icons and navigation
trallard c8219d2
Ensure navbar links behave under hover
trallard 069b9f1
Add temporary focus style
trallard ab2de3b
Remove underline from breadcrumbs
trallard 9868a85
remove EnOSlib (temporarily) to restore doc build
drammock d2ae03e
remove expectation of EnOSlib warning
drammock 8f7fcc8
:lipstick: Remove visited colour
trallard 5ae0473
Add focus style to search box
trallard File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 |
---|---|---|
@@ -0,0 +1,142 @@ | ||
# Accessibility | ||
|
||
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. | ||
|
||
:::{note} | ||
Issues and pull requests to identify or fix accessibility issues on this theme or site are heartily welcomed! | ||
::: | ||
|
||
## What We've Done | ||
|
||
### Metadata | ||
|
||
Several of our documentation pages contain metadata (i.e., `.. meta::` directives | ||
in reStructuredText) giving summaries of the page contents. If you notice a | ||
page that lacks metadata, please open a pull request to add it! | ||
|
||
### Colors | ||
|
||
- Our default code highlighting styles are `a11y-high-contrast-light` and | ||
`a11y-high-contrast-dark` from https://github.com/Quansight-Labs/accessible-pygments. | ||
These styles are designed to meet WCAG 2 AA or AAA contrast requirements. | ||
If you don't like the look of our default code highlighting styles, there are several more | ||
to choose from at https://github.com/Quansight-Labs/accessible-pygments. | ||
- We recently revisited the PyData Sphinx theme color palette to ensure that | ||
the colors we use meet WCAG 2 AA or AAA contrast requirements. | ||
- 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. | ||
|
||
## What You Can Do | ||
|
||
### Site configuration | ||
|
||
The following sections include recommendations for settings in the `conf.py` file that can positively impact the | ||
accessibility of content generated by this theme and Sphinx in general. | ||
|
||
### Natural Language | ||
|
||
If not using a more robust [internationalization approach](https://www.sphinx-doc.org/en/master/usage/advanced/intl.html), | ||
specifying at least the baseline natural language will help assistive technology | ||
identify if the content is in a language the reader understands. | ||
|
||
:::{hint} | ||
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. | ||
|
||
```python | ||
language = "en" | ||
``` | ||
|
||
::: | ||
|
||
### Add a Site Map | ||
|
||
Site maps, usually served from a file called `sitemap.xml` are a broadly-employed | ||
approach to telling programs like search engines and assistive technologies where | ||
different content appears on a website. | ||
|
||
If using a service like [ReadTheDocs](https://readthedocs.com), these files | ||
will be created for you _automatically_, but for some other approaches below, | ||
it's handy to generate a `sitemap.xml` locally or in CI with a tool like | ||
[sphinx-sitemap](https://pypi.org/project/sphinx-sitemap/). | ||
|
||
:::{hint} | ||
|
||
For a simple site (no extra languages or versions), ensure `sphinx-sitemap` | ||
is installed in your documentation environment, and modify your `conf.py`: | ||
|
||
```python | ||
extensions += ["sphinx_sitemap"] | ||
|
||
html_baseurl = os.environ.get("SPHINX_HTML_BASE_URL", "http://127.0.0.1:8000/") | ||
sitemap_locales = [None] | ||
sitemap_url_scheme = "{link}" | ||
``` | ||
|
||
::: | ||
|
||
### Logo best practices | ||
|
||
If you use both light and dark themes, it's best to provide a logo that works well in both or to provide an alternative for the dark theme. | ||
If you have a logo, you can add alt-text to it by adding the following to your | ||
`conf.py`: | ||
|
||
```python | ||
"logo": { | ||
"text": "PyData Theme", | ||
"image_dark": "_static/logo-dark.svg", | ||
"alt_text": "PyData Theme home", | ||
}, | ||
``` | ||
|
||
Note the use of "home" in the alt text to indicate that the logo is also a link to the home page. | ||
|
||
### In the Browser | ||
|
||
Several in-browser tools exist for interactively debugging the accessibility | ||
of a single page at a time and can be useful during the content development cycle. | ||
|
||
### Built-in tools | ||
|
||
Most major browsers, including [Firefox](https://developer.mozilla.org/en-US/docs/Tools/Accessibility_inspector) | ||
and [Chrome](https://developers.google.com/web/tools/chrome-devtools/accessibility/reference), | ||
have accessibility tools built-in as part of their web developer tools. | ||
These tools can help to quickly identify accessibility issues and often include links to standards. | ||
|
||
#### tota11y | ||
|
||
[tota11y](https://khan.github.io/tota11y/#Installation) is an open source | ||
"bookmarklet" which modifies the currently-loaded page in place and highlights | ||
several accessibility issues. | ||
|
||
#### WAVE | ||
|
||
[WAVE](https://wave.webaim.org/extension/) is a proprietary (but _gratis_) | ||
browser extension which can highlight multiple issues. | ||
|
||
:::{warning} | ||
Note that automated testing and extensions such as the ones mentioned above will at best catch 30-40% of accessibility issues. | ||
They are not a replacement for manual testing and having a perfect score on any of these tools does not mean that | ||
the site can be used by disabled users but instead signals that it follows some accessibility best practices. | ||
::: | ||
|
||
### In Continuous Integration | ||
|
||
Several automated tools are available for assessing _glaring_ accessibility | ||
issues across some pages at once, usually with many configurable options. | ||
|
||
#### Lighthouse | ||
|
||
[Lighthouse](https://developers.google.com/web/tools/lighthouse) provides an automated assessment of basic accessibility issues in addition to search engine | ||
automation, page performance, and other best practices. | ||
|
||
:::{hint} | ||
Specifically, [foo-software/lighthouse-check-action](https://github.com/foo-software/lighthouse-check-action) | ||
is run on selected pages from the generated documentation site. | ||
::: |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.