Module talk:Sidebar: Difference between revisions

Content deleted Content added
m Archiving 1 discussion(s) to Module talk:Sidebar/Archive 6) (bot
 
(4 intermediate revisions by 2 users not shown)
Line 15:
{{archives|search=yes|bot=MiszaBot II|age=90}}
{{Lua sidebar}}
 
== 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)
 
== Option to omit nomobile? ==
Line 52 ⟶ 45:
— [[User:DaZyzzogetonsGotDaLastWord|Daℤyzzos]] ([[User_talk:DaZyzzogetonsGotDaLastWord|✉️]] • [[Special:Contributions/DaZyzzogetonsGotDaLastWord|📤]]) 20:18, 29 July 2025 (UTC)
:{{replyto|DaZyzzogetonsGotDaLastWord}} On which page do you see this happening? Examples ''always'' help. --[[User:Redrose64|<span style="color:#a80000; background:#ffeeee; text-decoration:inherit">Red</span>rose64]] &#x1f339; ([[User talk:Redrose64|talk]]) 21:03, 29 July 2025 (UTC)
::First noticed it on [[Mathematics]].{{snd}}[[User:DaZyzzogetonsGotDaLastWord|Daℤyzzos]] ([[User_talk:DaZyzzogetonsGotDaLastWord|✉️]]&nbsp;•&nbsp;[[Special:Contributions/DaZyzzogetonsGotDaLastWord|📤]]) 23:22, 29 July 2025 (UTC) <ins>P.S. Just realized this&mdash;only happens on dark mode (probably should've checked that earlier, but oh well.) Also: using Chrome but also shows up in Safari on my phone (again only in dark mode).{{snd}}[[User:DaZyzzogetonsGotDaLastWord|Daℤyzzos]] ([[User_talk:DaZyzzogetonsGotDaLastWord|✉️]]&nbsp;•&nbsp;[[Special:Contributions/DaZyzzogetonsGotDaLastWord|📤]]) 23:28, 29 July 2025 (UTC)</ins>
:::This also occurs using Firefox, again dark mode only. The HTML that is served has <syntaxhighlight lang=html><table class="sidebar nomobile nowraplinks hlist">
<tbody>
<tr>
<td class="sidebar-pretitle">Part of a series on</td>
</tr>
<tr>
<th class="sidebar-title-with-pretitle">
<a class="mw-selflink selflink">Mathematics</a>
</th>
</tr>
...
</tbody>
</table></syntaxhighlight> In both dark and light mode, this comes with the following CSS: <syntaxhighlight lang=css>@media screen {
a.mw-selflink {
color: inherit;
font-weight: bold;
text-decoration: inherit;
}
}</syntaxhighlight> which is what makes the word "Mathematics" appear black and boldface. But in dark mode only, the following CSS (found in [[Module:Sidebar/styles.css]]) is used in addition: <syntaxhighlight lang=css>@media screen {
html.skin-theme-clientpref-night .mw-parser-output .sidebar:not(.notheme) .sidebar-title-with-pretitle a {
color: var(--color-progressive) !important;
}
}</syntaxhighlight> The last three simple selectors (<code>.sidebar:not(.notheme) .sidebar-title-with-pretitle a</code>) are what's causing the color to be overridden. The color value (<code>var(--color-progressive)</code>) is read from a variable that is set elsewhere. Why it's written that way, I don't know. --[[User:Redrose64|<span style="color:#a80000; background:#ffeeee; text-decoration:inherit">Red</span>rose64]] &#x1f339; ([[User talk:Redrose64|talk]]) 07:10, 30 July 2025 (UTC)
::::I did some [[WP:WikiBlame|WikiBlame]]-ing and discovered that the last bit of CSS in your comment (the <code>@media screen</code> one) was added in [[Special:Diff/1234103998|this edit]] to the style page by @[[User:Jdlrobson|Jdlrobson]] (pinging to find the reasons for the addition as the link in the edit summary is broken and a search for "Fall of Constantinople dark mode error" on talk pages turned up blank).{{snd}}[[User:DaZyzzogetonsGotDaLastWord|Daℤyzzos]] ([[User_talk:DaZyzzogetonsGotDaLastWord|✉️]]&nbsp;•&nbsp;[[Special:Contributions/DaZyzzogetonsGotDaLastWord|📤]]) 13:20, 30 July 2025 (UTC)