-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Style: Fix colors and style for all admonitions #2691
Style: Fix colors and style for all admonitions #2691
Conversation
I first took a look at tweaking the link color; in light code I was able to darken it a little to
I darkened the dark mode color to Likewise, I lightened the light mode color to
I lightened the light mode color from Also, I bumped the light mode attention/important color from The others I checked all were at to well above these latter levels, especially with the across the board link change. |
Thanks! We don't have to only adjust the "global" link colour, we can tailor it specifically for each admonition.
Yeah... One option with orange background is to have dark foreground text, then we can get a bright orange: Or this looks like a a good tool for finding contrast (with a guide here), you give it a foreground and background colours and tell it which one to edit, and it can give you a range of options. |
I made some further tweaks, making the link color higher contrast inside annotations only, while using some of the additional leeway to re-adjust the admonition colors to a more optimal sequence and modestly higher contrast from the background and each other, while still preserving at least a 4.5 contrast ratio between all of them (including, now, orange on the dark BG).
Yeah, I thought about that before, but didn't go for it at the time since it would require more theme variables, would still reduce the contrast between links and normal text, and it could look a little inconsistent. But that is probably the simplest and least impactful solution and less sub-optimal the shifting the BG colors more, so I went with it.
We could do that, but we'd have to switch all the other colors that might appear in the warning too, which is pretty non-trivial, and the background would have to be very bright compared to rest of the page and the other admonitions; we'd have to make at least
Great tool, thanks! Very handy. |
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.
Thank you!
If no one has any objections, I'll merge this in a ≈day so #2690 is ready to go whenever it gets merged. |
Going ahead and merging this so I can update #2690 with it |
Since the basic admonition admonition styles are just applied to a couple individual admonitions, rather than admonitions in general, those other than "warning" and "note" won't display as admonitions at all. In addition to fixing that, this PR adds appropriate, standard colors for each of the additional admonition types in both light and dark mode.
Discovered in and required by #2690 .
Slightly outdated screenshots also showing status quo