Skip to content

feat: improve interactive element color accessibility on api docs #9076

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

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

Conversation

1zzowiebeha
Copy link

@1zzowiebeha 1zzowiebeha commented Jul 21, 2025

implements: #9075

Description

The table of contents to the right of the page has a list of links that, when hovered, are given an underline. There is also a sidebar to the left of the page with titles and links to reference documentation. The color contrast on these elements can be improved by altering the hover and active state color of these elements for better visual accessibility.

This commit changes the color of these elements, along with the navbar, search widget, and jump anchors in a visually nice and accessible way. Some background and border transitions are included as well to make for a nice experience.

This extends to the light theme, dark theme, desktop screen width and mobile screen width.

Before and After demonstration:

before-and-after-compressed.1.mp4

(note: I forgot to showcase the search widget in this video)

Specific Changes proposed

This pull updates the CSS file located at /build/docs/styles/videojs.css.
It overrides some clean-jsdoc-theme default styles to make the page look nicer with better color contrast.

Requirements Checklist

  • Feature implemented / Bug fixed
  • If necessary, more likely in a feature request than a bug fix
    • Change has been verified in an actual browser (Chrome, Firefox, IE)
    • Unit Tests updated or fixed
    • Docs/guides updated
    • Example created (starter template on JSBin)
    • Has no DOM changes which impact accessiblilty or trigger warnings (e.g. Chrome issues tab)
    • Has no changes to JSDoc which cause npm run docs:api to error
  • Reviewed by Two Core Contributors

The table of contents to the right of the page
has a list of links that, when hovered,
are given an underline.

There is also a sidebar to the left of the page
with titles and links to reference documentation.

The color contrast on these elements can be
improved by adding a greater color contrast
for visual accessibility.

This commit changes the hover color of these
elements in a visually nice and accessible way.
Copy link

welcome bot commented Jul 21, 2025

💖 Thanks for opening this pull request! 💖

Things that will help get your PR across the finish line:

  • Run npm run lint -- --errors locally to catch formatting errors earlier.
  • Include tests when adding/changing behavior.
  • Include screenshots and animated GIFs whenever possible.

We get a lot of pull requests on this repo, so please be patient and we will get back to you as soon as we can.

Adds an opening transition when the search
container is displayed. Improves its parent
backdrop color contrast, as well as the
close button contrast on both the light and
dark themes.
@1zzowiebeha
Copy link
Author

1zzowiebeha commented Jul 21, 2025

I am in the process of also improving some of the other interactive elements- so please hold on merging for now. I don't expect it to take more than a day or two.

This commit adds a few border and background
color contrast changes, along with transitions
to the interactive elements on the page.

These include the navbar (top), table of contents
(right), sidebar (left), and mobile sidebar
elements at small screen sizes.
@1zzowiebeha
Copy link
Author

1zzowiebeha commented Jul 21, 2025

It's now ready for review :)

@1zzowiebeha 1zzowiebeha changed the title feat: improve sidebar and toc link accessibility feat: improve interactive element color accessibility Jul 21, 2025
@1zzowiebeha 1zzowiebeha changed the title feat: improve interactive element color accessibility feat: improve interactive element color accessibility on api ref docs Jul 21, 2025
@1zzowiebeha 1zzowiebeha changed the title feat: improve interactive element color accessibility on api ref docs feat: improve interactive element color accessibility on api docs Jul 21, 2025
if the user changes their browser font size
setting, px unit media queries will not adapt
to these changes and may cause the query to not
take effect, or to take effect at the wrong time.

rem units on the other hand do adjust based on
the browser's font size setting.

this commit switches unit values and types
to enable this behavior.
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.

1 participant