Template talk:Color
Add topic| Template:Color is indefinitely protected from editing as it is a heavily used or highly visible template. Substantial changes should first be proposed and discussed here on this page. If the proposal is uncontroversial or has been discussed and is supported by consensus, editors may use {{edit template-protected}} to notify an administrator or template editor to make the requested edit. Usually, any contributor may edit the template's documentation to add usage notes or categories.
Any contributor may edit the template's sandbox. Functionality of the template can be checked using test cases. |
| This template does not require a rating on Wikipedia's content assessment scale. It is of interest to the following WikiProjects: | ||||||||
| ||||||||
Interwiki
[edit]Hi! Could an admin add Polish interwiki to the template -> pl:Szablon:Kolor, please. Thanks Electron (talk) 15:28, 18 November 2011 (UTC)
Done by JAn Dudík. —LLarson (said & done) 15:01, 15 August 2016 (UTC)
- Thanks, better late than never ;) Electron (talk) 21:05, 16 August 2016 (UTC)
Redirects
[edit]I notice the documentation here is missing a list of redirects, as present elsewhere.
In particular, I would like to ask for the documentation to note that Template: Colour is redirected here. In other words, that Wikipedia is fine with editors using their preferred spelling of this word when invoking templates. ~Without having to experiment on their own, as I had to. Thanks, ~~ — Preceding unsigned comment added by CapnZapp (talk • contribs) 06:14, 25 January 2014 (UTC)
Done per CapnZapp’s request. —LLarson (said & done) 15:01, 15 August 2016 (UTC)
Brohoof! CapnZapp (talk) 20:57, 15 August 2016 (UTC)
Urgent: Please fix this template for printed content Template:Color/styles.css.
[edit]Firstly, apologies for writing in English if this is not your first language (this is an automated message).
This template has been detected as one of 436 pages using styles that break the page when printed when the user is using dark mode. The fix is very straightforward - all your styles relating to dark mode must be scoped to. Since there is a high risk of this templates being copied to other wikis it is important this notice is acted on ASAP.
To fix this:
- Update `@media (prefers-color-scheme: dark` to `@media screen and (prefers-color-scheme: dark`
- Wrap any styles relating to `html.skin-theme-clientpref-night` in `@media screen`
If this message has not been acted on in 7 days, this will be fixed by an automated script. Thank you for your help fixing this important issue.
For any questions feel free to ask them at phab:T369874.
Jon (WMF) (talk) 18:19, 2 August 2024 (UTC) on behalf of the web team.- This change has since been made. -- Beland (talk) 23:02, 12 September 2024 (UTC)
dark mode problem/alternative
[edit]@Theknightwho: Thank you for striving to improve Wikipedia.
Regarding this edit (and any others like it), apparently {{color}} does not function in dark mode, so Wikipedia's Spanish alphabet section said the letters that used to be part of the Spanish alphabet were shown in red, but displayed them in the same white as the rest of the alphabet. i switched that page back to this format
- <span style="color: RED ">this format</span>
which seems to work in light or dark mode.
If any text on Wikipedia is supposed to be in non-default colors, editors need to know if the wiki code they use is going to work. i'm not sure where else to spread the word about this hiccup, though.
i tried to use {{!xt|this template}} to get a reddish color, but Preview replaced my text with a big bold reddish alert saying, "Template:!xt is only for examples of style and formatting. Do not use it in actual articles." If the {color} template can not be made to work in dark mode, could the {color} template be set to display an {!xt}-style Preview alert about {color} not working in dark mode?
...Should this post move to Wikipedia:Village pump (idea lab)?
Wishing everyone safe, happy, productive editing. --70.22.1.45 (talk) 13:38, 28 August 2025 (UTC)
Can these templates be used in right-to-left languages?
[edit]Reading Vav-consecutive, and as a non-Hebrew reader, I thought it might be useful if the examples could pick out the "vav" letter in a different colour, in the way that {{Red|red}} yields red. So I began to try to edit one of them. But I was unable to make it work. Here's one example from that article:
- yôm wə-laylâ
- יוֹם וְלַיְלָה
- Day and night.
- yôm wə-laylâ
Is there a way to highlight that "vav" (the וְ in the middle).
Do these templates work with right-to-left languages?
Feline Hymnic (talk) 15:37, 11 March 2026 (UTC)
- To clarify: If the Latin-alphabet lines were to receive the highlight treatment, they would be:
- yôm wə-laylâ
- יוֹם וְלַיְלָה
- Day and night.
- yôm wə-laylâ
- My question is about doing the same for the "Script/Hebrew" line.
- Feline Hymnic (talk) 16:02, 12 March 2026 (UTC)
- Here you go: יוֹם וְלַיְלָה. It can be tricky to navigate a mix of left-to-right and right-to-left scripts, but after some trial and error, I was able to do it. —andrybak (talk) 18:12, 9 April 2026 (UTC)
- @Andrybak: Thank you. I've tried it in the article: three occurrences. I think it is correct, but a second pair of eyes would be welcome. Feline Hymnic (talk) 15:18, 11 April 2026 (UTC)
- Here you go: יוֹם וְלַיְלָה. It can be tricky to navigate a mix of left-to-right and right-to-left scripts, but after some trial and error, I was able to do it. —andrybak (talk) 18:12, 9 April 2026 (UTC)
Revert to version from 20:50, 14 August 2024 by Jonesey95
[edit]This edit request has been answered. Set the |answered= parameter to no to reactivate your request. |
@Dissident93: this doesn't shouldn't work in dark mode for a reason. See the comment from Jon (WMF) above. sapphaline (talk) 09:48, 29 June 2026 (UTC)
- Are you saying that it does not work in dark mode for you, or that you object to its usage in dark mode? ~ oklopfer (💬) 14:46, 29 June 2026 (UTC)
- I'm saying that this template shouldn't work in dark mode. sapphaline (talk) 14:57, 29 June 2026 (UTC)
- That's not what the WMF comment was stating, though; they were just stating how to fix it. What reasoning do you have that it shouldn't be allowed to work? ~ oklopfer (💬) 16:28, 29 June 2026 (UTC)
- Unless this is causing issues or breaking something, I don't see any reason why this shouldn't always work in dark mode. — Dissident93 (talk) 22:22, 29 June 2026 (UTC)
- That's not what the WMF comment was stating, though; they were just stating how to fix it. What reasoning do you have that it shouldn't be allowed to work? ~ oklopfer (💬) 16:28, 29 June 2026 (UTC)
- I'm saying that this template shouldn't work in dark mode. sapphaline (talk) 14:57, 29 June 2026 (UTC)
Not done: it's not clear what changes you want made. Please detail the specific changes in a "change X to Y" format and provide a reliable source if appropriate.—TechnoSquirrel69 (talk) 21:34, 30 June 2026 (UTC)- Sorry, I missed the section header for some reason. It seems like this is the change that the requestor wants reverted. I'm on the same page as people above — why should the dark mode compatibility be removed? —TechnoSquirrel69 (talk) 21:38, 30 June 2026 (UTC)
- The
!importantannotation is a cop-out. Usually, it means "I can't be bothered working out the proper specificity of the selectors, so I'll use a sledgehammer instead". --Redrose64 🌹 (talk) 21:24, 1 July 2026 (UTC)- I'm not fluent in Lua, but if it's causing zero technical or visual issues then what's the harm in leaving it? Does it go against MediaWiki recommendations? — Dissident93 (talk) 18:46, 5 July 2026 (UTC)
- The
!importantis overriding Template:Color/styles.css, but I am wondering why that exists. phab:T360683 claimsFor obvious reason this is not compatible with night theme
, but the reason is not obvious to me at all, nor is it clarified in the ticket comments. ~ oklopfer (💬) 23:31, 5 July 2026 (UTC)- Ah, I think I understand the issue now. Many calls of this template were made before dark mode was a thing, and so specify dark text colors that create poor contrast ratios or are invisible in dark mode. The solution seems to have been disabling the feature in dark mode; a bit of a nuclear option, though I see why that was done. I'm inclined to revert the changes as requested with that in mind, but maybe we could workshop some leniency to allow the template to function outside of mainspace or something. Izno, could you advise? —TechnoSquirrel69 (talk) 03:11, 6 July 2026 (UTC)
- On pages like secondary color, it is rather necessary to have working. The old method was to force
!importantinto the template call itself, which was a bit messy but better than the alternative of no color at all. - I think it is somewhat problematic to have it disabled on dark mode while still working on light, as editors often use colored text to make distinctions. These uses are problematic, and when I see them I often tag such pages or sections with {{overcoloured}}; but because I use dark mode I would not see them at all and be visually notified to tag them for fixing.
- But yes, Izno it would be good to hear your thoughts, given that most seemed to refer to you in that discussion. ~ oklopfer (💬) 04:04, 6 July 2026 (UTC)
- I think the preference is clearly "ensure sure the text is accessible". While in dark mode, the only ways to do that are to override the color emitted or to add a white/light background for all uses. I rather think the second is disruptive to the dark mode existence, but I don't really care if consensus wants to do the other one. (You can override whichever in your Common.css if you should want to be notified when {{color}} is being used.)
- To me, it's really just a matter of deprecating the template with some set of reasonable replacements. If someone wants to work on the 20k pages that use the template directly, I'm not stopping them, but it's definitely not on my list of things that I want to work on (or would be prioritizing even if I did).
- I think I enumerated the reasonable replacements already, more or less. Stuff like "stonks go up" should probably have a {{it went up color}}. Stuff like "my brand colors" probably needs a brand color stylesheet (I sketched out an idea on the task) or for us to decide that we shouldn't care about brand colors (hah good luck but hey you can try to get them deprecated). Specific colors for colors pages probably should avoid the use of this template in favor of direct use of the color with an appropriate and accessible background, though I suppose a {{I really mean this color}} template could be devised, or an option added to this one to mean the same. This group is going to be the flat minority of all uses, so I don't think the template should support it as the default. Some subset can just be removed because they're decorative and have no obvious meaning.
- I'm sure there are other subsets, but someone is going to have to work through the set. Izno (talk) 06:19, 6 July 2026 (UTC)
- I would not approach this as a question of "in certain namespaces", to be certain. Izno (talk) 06:19, 6 July 2026 (UTC)
- On pages like secondary color, it is rather necessary to have working. The old method was to force
- Ah, I think I understand the issue now. Many calls of this template were made before dark mode was a thing, and so specify dark text colors that create poor contrast ratios or are invisible in dark mode. The solution seems to have been disabling the feature in dark mode; a bit of a nuclear option, though I see why that was done. I'm inclined to revert the changes as requested with that in mind, but maybe we could workshop some leniency to allow the template to function outside of mainspace or something. Izno, could you advise? —TechnoSquirrel69 (talk) 03:11, 6 July 2026 (UTC)
- The
- Whether !important is relevant is a question of whether you can work around a selector. You cannot do so with inline styles, as this template emits. So, !important must be used. Izno (talk) 06:04, 6 July 2026 (UTC)
- So is this a visual issue regarding !important, a technical issue because it goes against a guideline of the template, or something else? I replace this template with specific color ones (for sport team wikilinks) and there have been zero complaints. — Dissident93 (talk) 18:07, 7 July 2026 (UTC)
- I'm not fluent in Lua, but if it's causing zero technical or visual issues then what's the harm in leaving it? Does it go against MediaWiki recommendations? — Dissident93 (talk) 18:46, 5 July 2026 (UTC)
- The
- Sorry, I missed the section header for some reason. It seems like this is the change that the requestor wants reverted. I'm on the same page as people above — why should the dark mode compatibility be removed? —TechnoSquirrel69 (talk) 21:38, 30 June 2026 (UTC)