Template talk:Southern California Intercollegiate Athletic Conference navbox
Latest comment: 5 months ago by Jon (WMF) in topic Night mode compatibility?
This template does not require a rating on Wikipedia's content assessment scale. It is of interest to the following WikiProjects: | ||||||||||||||||||||||
|
Night mode compatibility?
edit@SGrabarczuk (WMF), is there documentation anywhere on how to make templates like this compatible with the new dark mode? Sdkb talk 22:14, 9 May 2024 (UTC)
- Hey @Sdkb, the only documentation I know of is the recommendations page. I think the problem of templates like this is not addressed anywhere directly, because the team doesn't go that far in telling how to format stuff. As a Wikipedian, I avoid conveying information just with color wherever possible. I guess it must be documented somewhere in MoS; perhaps it's not discouraged strongly enough? SGrabarczuk (WMF) (talk) 00:39, 14 May 2024 (UTC)
- @SGrabarczuk (WMF), I should have been more specific about the issue. When I enable night mode for this template, the title bar goes completely black. This behavior takes something that was previously working (in the sense that navbox coloring is permissible, and is used decoratively rather than to convey information) and breaks it, so I don't think "just don't use colored navboxes" is an acceptable resolution. There should be some way to fix this. Sdkb talk 04:39, 14 May 2024 (UTC)
- Thanks for clarification. Isn't this case covered by "Avoid static values for inline background and text colors"? SGrabarczuk (WMF) (talk) 11:14, 14 May 2024 (UTC)
- @SGrabarczuk (WMF), ah, yeah, that does speak to it. To the extent I understand it, the advice there seems to be a mix of "just don't use color" and a workaround involving TemplateStyles.
- Regarding the former, I think it would be an extremely heavy lift consensus-wise to try to convince the community to take that approach. Views among community members differ as to what extent it is permissible to use color in applications like this (a tinderbox that you probably don't want to ignite with yourselves at the center), but the status quo is that a quite large portion of navboxes (especially in areas like sports) use colored theming, and I don't see that changing anytime soon.
- Regarding the workaround, most editors (including me) don't have a strong understanding of TemplateStyles. Trying to follow the instructions there, I get stuck on the fact that it uses a class, whereas navboxes use
|basestyle=
, which presumably invokes a style. Also, if possible, it'd be nice not to have to create an entire separate {{Southern California Intercollegiate Athletic Conference navbox/styles.css}} page just for this one thing. - Ultimately, if you're hoping for templates like this to be adapted for night mode, the method will need to be easier than it is presently. The best option might be for us to create something like
|nightbasestyle=
for {{Navbox}}. Is that currently possible, or would it require technical changes on your end before we could do it? If nothing is done, I predict it will make the rollout of night mode messier, with editors disgruntled about navboxes like this breaking but unsure how to fix them. - Cheers, Sdkb talk 19:43, 14 May 2024 (UTC)
|nightbasestyle=
is not possible at all in any meaningful sense - you cannot do media queries in inline CSS. This is why TemplateStyles is a recommendation. Another option would be for us to do the work to make our template base styles support night mode and then turn off the usually!important
styles that are being set in the night mode stylesheets that WMF has added to hack around our use of inline styles. This is a chunk of work that I have been trying to get to and which is completely unmotivational because it will be the usual "we don't want to change" from English Wikipedians. Including yourself in the above, apparently. (Also, it's a lot of work.)- Cases like these sports navboxes should be supported by those stylesheets and my impression is that they more or less were. Izno (talk) 19:52, 14 May 2024 (UTC)
- I'm trying to parse your reply, Izno (less technical explanation is always appreciated).
- If I understand correctly, you're saying that we have two options. The first (and your preferred) is to start creating /styles.css subpages for navboxes like this to define the colors for night mode (in this case probably flipping the background and text so that it's blue on black, rather than black on blue). The second is for us to make the default color scheme support night mode, which would then allow the WMF to turn off the setting that is forcing the black background and creating the issue here. In that case, would templates with no night mode colors specified revert to the default night colors when night mode is turned on, or would they keep their existing colors? I could see arguments either way.
- Did I get all of that (or even most of it) correct? Sdkb talk 20:18, 14 May 2024 (UTC)
- I said only that TemplateStyles is a recommended solution, not that it is even my preferred solution necessarily. :)
default color scheme support night mode, which would then allow the WMF to turn off the setting that is forcing the black background and creating the issue here
which would allow us to turn it off, but then we still need to go around cleaning stuff up for all the not-base colored things. Which would inevitably leads to some solution similar to TemplateStyles everywhere, usually.- My impression remains though that I think there is some CSS that is interacting unexpectedly in the relevant hacks here and think it would be meaningful for Jon (WMF) to take a look and make sure orderings and all are as expected. Izno (talk) 20:57, 14 May 2024 (UTC)
- The issue here as I understand it is the use of Template:Colored link which outputs:
- Thanks for clarification. Isn't this case covered by "Avoid static values for inline background and text colors"? SGrabarczuk (WMF) (talk) 11:14, 14 May 2024 (UTC)
- @SGrabarczuk (WMF), I should have been more specific about the issue. When I enable night mode for this template, the title bar goes completely black. This behavior takes something that was previously working (in the sense that navbox coloring is permissible, and is used decoratively rather than to convey information) and breaks it, so I don't think "just don't use colored navboxes" is an acceptable resolution. There should be some way to fix this. Sdkb talk 04:39, 14 May 2024 (UTC)
color: black; text-decoration: inherit;
- That template is problematic in the dark theme as it sets a color but assumes a white background.
- Here is one fix following the guideline Szymon pointed to that I think gives you the desired result:
- https://en.wikipedia.org/w/index.php?title=Template%3ASouthern_California_Intercollegiate_Athletic_Conference_navbox&diff=1223912547&oldid=1223101445
- I appreciate this may not be intuitive however for non-technical editors.... I think that's where us technical editors need to abstract this better. Another approach would be to create a new template Template:Color link as text or encode this behaviour inside Navboxes to avoid you needing to use it at all.
- On a general note, and speaking to your point this kind of thing is going to be "extremely heavy lift consensus-wise" - I do think this will be challenging, and that's okay. I think this Template is problematic in the case way that Template:Color is (as discussed in phab:T360683)... if we want a functioning dark mode of the site, we need to be more limited in our use of color on wiki and reserve it only for semantic reasons, rather than cosmetic e.g. to match a brand colors and when used, this should really be codified in a template that knows how to handle it in dark mode.
- Dark mode is going to be a little disruptive on the short term as it as it fundamentally changes some assumptions around always having white text on black background that we've been relying on for 10+ years - but I believe it's going to lead to more portable/adaptable/better content on the long run. Jon (WMF) (talk) 03:53, 15 May 2024 (UTC)
- Thanks for that edit, @Jon (WMF)! I'm not sure what it did, but on checking, it fixed the problem — well, 90% of it, since the {{VTE}} links in the corner are still dark, something that also affects every navbox with the default color scheme right now, and should therefore probably be prioritized for a fix.
- Would there be a reason not to apply that same code to {{Colored link}} so that it works everywhere? My concern is obviously not just this one small navbox, but rather the larger phenomenon of how we're going to deal with the thousands like it, so encoding within the colored link template or within {{Navbox}} would be better. (It's worth noting that not all navbox coloring uses {{Colored link}} rather than HTML directly, so Navbox may be the better approach.)
- Regarding your general note, I should clarify that my consensus concerns apply only if the route we take is "just don't use color," meaning e.g. in this case advice to just revert to the standard base colors for both light and night mode. That's the path I'm advising against — there's no intrinsic reason that the implementation of night mode has to affect the appearance in light mode, and if you try to force changes there, it'll open the how-should-we-use-color can of worms, generating opposition from pro-color editors who will make your work trying to get night mode approved harder. If a solution to the all-black problem is offered that keeps appearance in light mode the same, I don't think there will be consensus concerns — no matter what happens to templates like this in night mode (forced white-on-black, colors kept the same as light mode, or colors inverted somehow), it'll be an improvement over the status quo in which there's no night mode. There might still be tech-support concerns, though, if the solution is too hard to implement. Sdkb talk 23:45, 15 May 2024 (UTC)
- Colored link accepts any color. You could map these colors to dark mode friendly ones - for example black could appear black in light theme and white in dark theme ... but that might be confusing?
{{Colored link|black}} {{Colored link|white}}
- I see in the examples on Template:Colored_link you can already generate a white link if you want so presumably this is meant to be used only if you know what you are doing. For now (as volunteer) I've added some notes to the documentation: Template:Colored link/doc#Usage
- I think for this specific case, it would be better handled in the navbox itself. Jon (WMF) (talk) 15:53, 16 May 2024 (UTC)