-
Notifications
You must be signed in to change notification settings - Fork 356
ENH: Accessible code highlighting styles #1064
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
Conversation
|
🎉 this looks great @drammock |
| """ | ||
| default_light_theme = "tango" | ||
| default_dark_theme = "monokai" | ||
| Overwrite pygments.css to allow dynamic light/dark switching. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would something like this work for all the Sphinx-based docs? I mean, adding this bit to allow for the dynamic switch?
If so I'd love to add this to the "mini-docs" of accessible-pygments
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think so? I think we adapted it from the Furo theme.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I confirm that I adapted it from Furo.
choldgraf
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change looks good to me - could you add documentation about this in our user guide? I think we could add an Accessibility in this theme section to our Design and style section that could note the various accessibility-minded decisions that have been made here (such as the code blocks, and the default colors).
Also in the name of iteration I'd suggest scoping this PR to just the code blocks, and do the default colors in a follow up.
@drammock could you then update the comment (avoid closing the issue) and the title ? |
done, though I put it on the "accessibility" page instead (seemed like the right place 😉).
done
done, and CIs are happy. This one's ready from my end. |
choldgraf
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great - thanks for this improvement @drammock and to the QS folks for building the accessible pygments repository!
|
Is there a configuration option available to revert back to the old light/dark default themes? Or perhaps can the accessibility themes be toggled? |
to get the old defaults you can specify this in your html_theme_options = {
# ...other config vals...
"pygment_light_style": "tango",
"pygment_dark_style": "monokai",
} |
partially addresses #1052
__init__a11y-high-contrast-{dark|light}update theme color palette to address text contrast issues-> subsequent PRmake our CIs test for text contrast issues-> subsequent PR