Module talk:Sidebar/Archive 6: Difference between revisions

Content deleted Content added
m Archiving 1 discussion(s) from Module talk:Sidebar) (bot
m Archiving 1 discussion(s) from Module talk:Sidebar) (bot
 
(5 intermediate revisions by the same user not shown)
Line 122:
:::::'''BEWARE''' any change you make affects '''all''' pages using that sidebar. You should discuss any changes on the [[Template_talk:LGBT]] page, or better ask someone else to do the edits the first time. [[User:Johnjbarton|Johnjbarton]] ([[User talk:Johnjbarton|talk]]) 03:03, 30 November 2023 (UTC)
::::::Brilliant, thank you - exactly what I needed to know; and yes, I will take your advice re editing this. [[User:Chrisdevelop|Chrisdevelop]] ([[User talk:Chrisdevelop|talk]]) 03:28, 30 November 2023 (UTC)
 
== Hide image ==
 
Hi. I'd like to hide the image in {{tlx|IPCC}}, when it's invoked in [[IPCC]], which already has the same image in {{tlx|infobox organization}}. I've tried <code><nowiki>content1 = {{IPCC|child=yes}}</nowiki></code> but it didn't work. Does anybody know if that's possible? Otherwise, it might be better to remove the sidebar from that article. Thanks! [[User:Fgnievinski|fgnievinski]] ([[User talk:Fgnievinski|talk]]) 15:22, 21 January 2024 (UTC)
 
I've noticed [[Longitude]] invokes [[Template:Geodesy]] with parameter "notshowfig=1" which seems to be ignored. [[User:Fgnievinski|fgnievinski]] ([[User talk:Fgnievinski|talk]]) 05:18, 4 February 2024 (UTC)
 
Here's another example where the sidebar image duplicates the lead image: [[Light cone]]. [[User:Fgnievinski|fgnievinski]] ([[User talk:Fgnievinski|talk]]) 05:19, 4 February 2024 (UTC)
 
== Add support for V T E ==
 
Can you add support for V T E <code><nowiki>{{navbar|Template Name|mini=y}}</nowiki></code> in the bottom right corner of this template like many other templates have? [[User:Qwerty284651|Qwerty284651]] ([[User talk:Qwerty284651|talk]]) 02:32, 5 June 2024 (UTC)
:{{replyto|Qwerty284651}} It's called a navbar, and it's already present. Why do you think that it isn't? --[[User:Redrose64|<span style="color:#a80000; background:#ffeeee; text-decoration:inherit">Red</span>rose64]] &#x1f339; ([[User talk:Redrose64|talk]]) 15:37, 5 June 2024 (UTC)
::I meant to add to the {{tl|sidebar}} template the ability display VTE i.e. the <code><nowiki>{{navbar|Template Name|mini=y}}</nowiki></code>. [[User:Qwerty284651|Qwerty284651]] ([[User talk:Qwerty284651|talk]]) 16:28, 5 June 2024 (UTC)
:::Same answer, same question. It's already present in [[Template:Sidebar]], so, why do you think that it isn't? If something isn't working as expected. you ''need'' to provide examples. --[[User:Redrose64|<span style="color:#a80000; background:#ffeeee; text-decoration:inherit">Red</span>rose64]] &#x1f339; ([[User talk:Redrose64|talk]]) 18:16, 5 June 2024 (UTC)
::::I don't see VTE in {{tl|Tennis tournaments}}. [[User:Qwerty284651|Qwerty284651]] ([[User talk:Qwerty284651|talk]]) 18:22, 5 June 2024 (UTC)
:::::You need a {{para|name}} parameter, {{diff|Template:Tennis tournaments|prev|1227452320|like this}}. It is documented, at [[Template:Sidebar#Parameters]], particularly in the paragraph before the table. --[[User:Redrose64|<span style="color:#a80000; background:#ffeeee; text-decoration:inherit">Red</span>rose64]] &#x1f339; ([[User talk:Redrose64|talk]]) 20:19, 5 June 2024 (UTC)
 
== Urgent: Please fix this template for printed content [[Module:Sidebar/styles.css]]. ==
 
<div lang="en" dir="ltr">
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]].
 
[[User:Jon (WMF)|Jon (WMF)]] ([[User talk:Jon (WMF)|talk]]) 18:22, 2 August 2024 (UTC) on behalf of the web team.
 
</div>
 
== Missing CSS variable? ==
 
On row 385 there is the line <code>:cssText('color: var(--color-base)')</code>, but the --color-base CSS variable doesn't seem to be defined anywhere? [[User:MKFI|MKFI]] ([[User talk:MKFI|talk]]) 13:18, 15 October 2024 (UTC)
 
:{{ping|Jdlrobson}} I see that you {{diff|Module:Sidebar|diff=1226521837|label=added}} this. Where is the CSS variable defined? And why is this an inline style declaration instead of a class? Now dependent templates have problems changing text colors without using !important CSS declarations. [[User:MKFI|MKFI]] ([[User talk:MKFI|talk]]) 11:20, 17 October 2024 (UTC)
::The variable is defined in [https://doc.wikimedia.org/codex/latest/design-tokens/color.html the mediawiki design system]. It is active on the default skins of Vector 2022 and Minerva and is essential to make this template work in dark mode. It is not defined on opt in skins such as Monobook and Vector and there it will be ignored (we can add a fallback if that is useful and less confusing).
::[https://m.mediawiki.org/wiki/Recommendations_for_night_mode_compatibility_on_Wikimedia_wikis this link] should have lots of helpful context. Let me know if you have any follow up questions. <span style="background:white; color: black;">🐸</span>&nbsp;[[User:Jdlrobson|Jdlrobson]] ([[User talk:Jdlrobson|talk]]) 18:00, 18 October 2024 (UTC)
:::{{ping|Jdlrobson}} this module is used a base for multiple other templates. Your change overrides derived template style declarations and caused for example [[Template:Zoroastrianism sidebar]] to display black-on-red text which made it difficult to read instead of white-on-red as it should. This module has a [[Module:Sidebar/styles.css|stylesheet]]. Does the color variable really need to be an inline style declaration instead of a line in .sidebar-list-title class? [[User:MKFI|MKFI]] ([[User talk:MKFI|talk]]) 08:10, 19 October 2024 (UTC)
::::Presumably it could be added via a class. When dark mode was rolled out, for templates I was less familiar with I usually went with the most straightforward solution. I see this one uses [[Module:Sidebar/styles.css]] ?
::::You should be able to see the exact issue it fixes (unreadable black text on a black background) by visiting https://en.wikipedia.org/wiki/Template:Sidebar/testcases?useskin=vector-2022&vectornightmode=1
::::and undoing that inline style using this code: <syntaxhighlight lang=javascript>
$('.sidebar-list-title[style]').each((a,i)=>i.setAttribute('style',i.getAttribute('style').replace('color: var(--color-base)', '')))
</syntaxhighlight>
::::So you could likely move it to CSS, test if the issue is resolved and then undo my change. <span style="background:white; color: black;">🐸</span>&nbsp;[[User:Jdlrobson|Jdlrobson]] ([[User talk:Jdlrobson|talk]]) 16:21, 19 October 2024 (UTC)
:::::{{ping|Jdlrobson}} I can't do the change myself - the module and stylesheet are both template-protected. [[User:MKFI|MKFI]] ([[User talk:MKFI|talk]]) 08:33, 20 October 2024 (UTC)
 
== Templatestyles parameter ==
 
{{re|Izno}} Are there [[Wikipedia_talk:TemplateStyles/Archive_1#c-Izno-2018-07-27T01:35:00.000Z-In_the_context_of_meta_templates|still]] benefits of the caller templates using the numerous parameters {{para|templatestyles}}, {{para|child templatestyles}}, and {{para|grandchild templatestyles}} over a simple {{xtag|templatestyles}} in each? [[Special:Contributions/172.97.141.219|172.97.141.219]] ([[User talk:172.97.141.219|talk]]) 10:39, 30 November 2024 (UTC)
 
:Yes. Using the dedicated parameter allows you to use the cascading part of CSS, namely that the CSS in the child will apply after, not before the core TemplateStyles. This avoids the case where the child's styles are potentially overridden by styles of the same specificity in the core styles. You should generally always use these parameters. [[User:Izno|Izno]] ([[User talk:Izno|talk]]) 06:03, 1 December 2024 (UTC)
 
== Treating [[Module:Navbar/styles.css]] ==
 
{{ping|Izno}} Is it right not to treat [[Module:Navbar/styles.css]] in add_list_styles() whether sidebar has a navbar or not? If an article page transcludes a sidebar (with a navbar) and another navbar in this order, the styles doesn't seem to be applied on mobile view. [[User:本日晴天|本日晴天]] ([[User talk:本日晴天|talk]]) 15:42, 24 December 2024 (UTC)
 
:add_list_styles is just for the two kinds of lists and is about the classes that have been added since eternity in the several templates (infobox also). Both navbox and sidebar have instead move_hiding_templatestyles which will take care of embedded TemplateStyles tags. [[User:Izno|Izno]] ([[User talk:Izno|talk]]) 17:32, 24 December 2024 (UTC)
::Okay, but on some pages (ex. [https://en.m.wikipedia.org/wiki/Finder_(software)#Timeline Finder_(software)]) on mobile view, navbars are actually displayed in unintended styles because [[Module:Navbar/styles.css]] isn't used. How about modifying this module [[Special:Diff/1129707986/1265334216|like this]] and output an additional templatestyles tag if navbar is used? [[User:本日晴天|本日晴天]] ([[User talk:本日晴天|talk]]) 08:19, 27 December 2024 (UTC)