Skip to content

Change button text contrast to comply with WCAG AA - #269

Merged
steppi merged 1 commit into
jupyterlite:mainfrom
mfisher87:wcag-aa-contrast
Feb 17, 2025
Merged

Change button text contrast to comply with WCAG AA#269
steppi merged 1 commit into
jupyterlite:mainfrom
mfisher87:wcag-aa-contrast

Conversation

@mfisher87

@mfisher87 mfisher87 commented Feb 16, 2025

Copy link
Copy Markdown
Collaborator

Currently contrast of white-on-yellow is 1.34:1, but WCAG AA requires 4.5:1!

This is also more consistent with the JupyterLite logo which is black-on-yellow.


Separately, I expected the CSS for styling the button to be included with this extension, but the CSS seems to only be present in the docs of this extension. Is that intended, or should the CSS be bundled?

image

I got my docs page looking nice by copying the CSS over to my Sphinx custom CSS file.

Currently 1.34:1, but WCAG AA requires 4.5:1.
@steppi steppi added the documentation Improvements or additions to documentation label Feb 17, 2025
@steppi

steppi commented Feb 17, 2025

Copy link
Copy Markdown
Collaborator

Thanks @mfisher87. The buttons in the docs look much better now.

Separately, I expected the CSS for styling the button to be included with this extension, but the CSS seems to only be present in the docs of this extension. Is that intended, or should the CSS be bundled?

Currently users are expected to add CSS to style the buttons themselves. That's what's documented here, https://jupyterlite-sphinx.readthedocs.io/en/stable/directives/try_examples.html#configuration. I didn't have much web development experience when I first wrote the try_examples directive, and basically just punted on trying to come up with a good default style. At this point, it does seem like a good idea to have a reasonable default though.

@steppi
steppi merged commit a4adce7 into jupyterlite:main Feb 17, 2025
@mfisher87
mfisher87 deleted the wcag-aa-contrast branch February 17, 2025 05:55
@mfisher87

Copy link
Copy Markdown
Collaborator Author

Currently users are expected to add CSS to style the buttons themselves. That's what's documented here, jupyterlite-sphinx.readthedocs.io/en/stable/directives/try_examples.html#configuration.

Ahh, I had read this documentation but ignored it because I didn't think it also applied to the jupyterlite directive! Thanks for clarifying ❤️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants