-
Notifications
You must be signed in to change notification settings - Fork 339
tip
, hint
, and important
admonition colors
#1040
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
Comments
I don't have a strong opinion on admonition colors, what are the other themes doing ? |
Here are a few of the popular themes:
Other themes: Bootstrap 5: Bootstrap 4: Some themes might use different CSS frameworks, too. There are not always clear and obvious style mappings from Sphinx admonitions to Bootstrap alerts. I don't know whether authors considered the meaning of color in admonitions, especially with the recent development of beautiful modern themes and the options they offer. |
I would say RDT is the most common one so anything they select is considered as standard for the Python community. Maybe we could align on the colors they selected and be fancier on the icons? |
we are basically already aligned with what RTD theme does as far as colors (material is also the same as RTD on colors). The only deviation is that we color our versionadded, versionchanged, and deprecated messages. As far as icons goes, RTD uses one icon for all of them, we already use 5 different icons (material uses 4). Here's how it shakes down: we define these colors:
and these icons:
which admonition types get which combination of icon+color is defined here
To me this is actually pretty good. Everything has a different combo of color+icon except for:
...and to me it makes sense to treat hint & tip as "roughly the same", and to treat caution & warning as "rougly the same" --- e.g., if pressed to say how I would use "hint" differently than "tip" in my own docs, I'm not sure I'd have a clear answer. I'm not crazy about "note" and "default" being identical, perhaps because "default" allows a custom admonition title which means it might not necessarily be suited to an "info" icon. Turning to the OP's proposals: I can see the argument for attention & important being "roughly the same" semantically (in the way that hint & tip or caution & warning are "roughly the same") --- though I disagree about "important" being most similar to "caution"; in this case the result would be the same (important would get warning color). However, unifying them would break with the pattern used by RTD & material themes. So if we're taking our cue from RTD then we should probably leave the colors alone. As for the proposal to make hint & tip use the info color, I'm definitely -1 on that. Partly because I don't see the problem / confusion with "green means go" here --- hints and tips are meant to make things easier, speed users along their way, etc. Sure, they're informative, but all of the admonitions are informative in some sense. That doesn't mean they should all have the info color. The other reason not to change hint & tip to the info color is that if we do that and we accept the OP's other proposal (which is IMO the better idea) then we wouldn't be using our success color for any admonitions, which seems suboptimal. Aside: If we are going to break with RTD/material on colors, I'd be open to the idea of adding a fifth and even sixth color (purple? pink? brown?) and (partially?) decoupling the primary/secondary colors (used for website structural elements) from the semantic colors (used for admonitions). If others are interested in that, feel free to pull out this paragraph into a separate issue. |
I don't assume the RTD theme authors analyzed the meaning of color and icons for admonitions. A quick search into their history reveals there was not much, if any, thought put into it. If they had, then it would make sense to follow their lead. As it is, it makes sense to remedy the oversight. In fact there are some open issues in the RTD theme to resolve some problems with their admonition styles. Do we have consensus to remedy the oversight of admonition icon and color combination meanings, and not just copy another theme? |
Well, as you've seen above, @12rambau says he doesn't have strong feelings about it, and I've expressed my opinion (that I'm in favor of one of your proposed changes and against the other, and open to other ideas about color changes). @choldgraf do you want to weigh in? |
After thinking about it a bit, a few quick thoughts
|
let me update the PR including these modifications as it sounds reasonable to me (I'll check what we can do with yellow (as it's not a predefined color anymore) |
@stevepiercy did the merge of #1043 solved your issue ? |
@12rambau no. Caution should be yellow. I get it that PyData chose admonition colors based on its palette, and that the majority thinks distinct color/icon combinations are a good thing. I think the theme has too many admonition colors, which makes it difficult to design considering dark/light and accessibility. I'll just override colors in our theme to simplify things, eliminating orange. At least it is easy to override. I will close this as "won't fix". |
I think the
tip
andhint
admonitions are OK as green, but I think blue would be a better color. The color green has an international context of "go", whereas blue has a context of "information".Additionally I think
important
should be yellow, not green, as it is similar in purpose and context tocaution
.See currrent examples:
https://pydata-sphinx-theme.readthedocs.io/en/stable/examples/kitchen-sink/admonitions.html
See also original discussion:
executablebooks/sphinx-book-theme#597 (comment)
I would be happy to submit a PR, upon consensus.
The text was updated successfully, but these errors were encountered: