TDG EMPIRE
☰
Features
Wiki
Gallery
Webmap
Interactive Map
Punishments
Discord
Wiki
TDG Encyclopedia
Not logged in
Talk
Contributions
Create account
Log in
Search
Module
Discussion
Read
Edit source
Add topic
View history
Editing
Module talk:Sidebar
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
== Template-protected edit request on 15 June 2026 == {{Edit template-protected|Module:Sidebar/styles.css|answered=yes}} '''Fix sidebar title color and accessibility in dark mode for all sidebar types''' Based on the consensus for "Option B" in the discussion above, I request a comprehensive update to the dark mode CSS blocks. The current rules force links inside sidebar titles to stay link-blue (<code>var(--color-progressive)</code>) regardless of the link state (including self-links on the subject page). Additionally, this updated request expands the fix to cover standard sidebars using <code>.sidebar-title</code> (not just those with pre-titles), and safeguards accessibility against legacy inline background styles. '''Specific code change:''' Find: <syntaxhighlight lang="css"> @media screen { html.skin-theme-clientpref-night .sidebar:not( .notheme ) .sidebar-list-title, html.skin-theme-clientpref-night .sidebar:not( .notheme ) .sidebar-title-with-pretitle { background: transparent !important; } html.skin-theme-clientpref-night .sidebar:not( .notheme ) .sidebar-title-with-pretitle a { color: var( --color-progressive ) !important; } } @media screen and (prefers-color-scheme: dark) { html.skin-theme-clientpref-os .sidebar:not( .notheme ) .sidebar-list-title, html.skin-theme-clientpref-os .sidebar:not( .notheme ) .sidebar-title-with-pretitle { background: transparent !important; } html.skin-theme-clientpref-os .sidebar:not( .notheme ) .sidebar-title-with-pretitle a { color: var( --color-progressive ) !important; } } </syntaxhighlight> Replace with: <syntaxhighlight lang="css"> @media screen { /* 1. For standard bars without inline backgrounds: inherits proper dark mode text color */ html.skin-theme-clientpref-night .sidebar:not( .notheme ):not([style*="background"]):not([style*="background-color"]) .sidebar-title, html.skin-theme-clientpref-night .sidebar:not( .notheme ):not([style*="background"]):not([style*="background-color"]) .sidebar-title-with-pretitle { background: transparent !important; } html.skin-theme-clientpref-night .sidebar:not( .notheme ):not([style*="background"]):not([style*="background-color"]) .sidebar-title a, html.skin-theme-clientpref-night .sidebar:not( .notheme ):not([style*="background"]):not([style*="background-color"]) .sidebar-title-with-pretitle a { color: inherit !important; } /* 2. Automated fallback: For sidebars carrying hardcoded/inline light backgrounds, forces safe dark background and white text */ html.skin-theme-clientpref-night .sidebar[style*="background"] .sidebar-title, html.skin-theme-clientpref-night .sidebar[style*="background-color"] .sidebar-title, html.skin-theme-clientpref-night .sidebar[style*="background"] .sidebar-title-with-pretitle, html.skin-theme-clientpref-night .sidebar[style*="background-color"] .sidebar-title-with-pretitle, html.skin-theme-clientpref-night .sidebar [style*="background"], html.skin-theme-clientpref-night .sidebar [style*="background-color"] { background-color: var(--background-color-neutral-subtle, #202122) !important; background: var(--background-color-neutral-subtle, #202122) !important; } html.skin-theme-clientpref-night .sidebar[style*="background"] .sidebar-title a, html.skin-theme-clientpref-night .sidebar[style*="background-color"] .sidebar-title a, html.skin-theme-clientpref-night .sidebar[style*="background"] .sidebar-title-with-pretitle a, html.skin-theme-clientpref-night .sidebar[style*="background-color"] .sidebar-title-with-pretitle a, html.skin-theme-clientpref-night .sidebar .sidebar-heading, html.skin-theme-clientpref-night .sidebar .sidebar-list-title { color: #ffffff !important; } } @media screen and (prefers-color-scheme: dark) { /* 1. For standard bars without inline backgrounds */ html.skin-theme-clientpref-os .sidebar:not( .notheme ):not([style*="background"]):not([style*="background-color"]) .sidebar-title, html.skin-theme-clientpref-os .sidebar:not( .notheme ):not([style*="background"]):not([style*="background-color"]) .sidebar-title-with-pretitle { background: transparent !important; } html.skin-theme-clientpref-os .sidebar:not( .notheme ):not([style*="background"]):not([style*="background-color"]) .sidebar-title a, html.skin-theme-clientpref-os .sidebar:not( .notheme ):not([style*="background"]):not([style*="background-color"]) .sidebar-title-with-pretitle a { color: inherit !important; } /* 2. Automated fallback */ html.skin-theme-clientpref-os .sidebar[style*="background"] .sidebar-title, html.skin-theme-clientpref-os .sidebar[style*="background-color"] .sidebar-title, html.skin-theme-clientpref-os .sidebar[style*="background"] .sidebar-title-with-pretitle, html.skin-theme-clientpref-os .sidebar[style*="background-color"] .sidebar-title-with-pretitle, html.skin-theme-clientpref-os .sidebar [style*="background"], html.skin-theme-clientpref-os .sidebar [style*="background-color"] { background-color: var(--background-color-neutral-subtle, #202122) !important; background: var(--background-color-neutral-subtle, #202122) !important; } html.skin-theme-clientpref-os .sidebar[style*="background"] .sidebar-title a, html.skin-theme-clientpref-os .sidebar[style*="background-color"] .sidebar-title a, html.skin-theme-clientpref-os .sidebar[style*="background"] .sidebar-title-with-pretitle a, html.skin-theme-clientpref-os .sidebar[style*="background-color"] .sidebar-title-with-pretitle a, html.skin-theme-clientpref-os .sidebar .sidebar-heading, html.skin-theme-clientpref-os .sidebar .sidebar-list-title { color: #ffffff !important; } } </syntaxhighlight> '''Rationale:''' # '''Completeness:''' The original patch only targeted <code>.sidebar-title-with-pretitle</code>. When a template does not use a pre-title, the MediaWiki parser generates <code>.sidebar-title</code> instead. This new code patches both classes simultaneously. # '''Contrast & Accessibility Safeguard:''' Simply changing the text color to <code>inherit</code> introduces accessibility problems on older articles/templates that still rely on hardcoded inline light backgrounds (e.g., <code>style="background:#A3BFB1;"</code>). Over a light background, <code>inherit</code> turns text white/light gray in dark mode, making it invisible. This updated logic utilizes attribute selectors (<code>[style*="background"]</code>) to capture those legacy edge-cases, dynamically overriding the inline style to a safe dark canvas (<code>#202122</code>) and forcing white text for absolute contrast. For regular templates without inline styling, it smoothly switches to <code>inherit</code> as intended. --[[User:GKNishimoto|GKNishimoto]] ([[User talk:GKNishimoto|talk]]) :{{question}}<!-- Template:ETp --> @[[User:GKNishimoto |GKNishimoto]], Do you have cases you can point wrt to problems with the current CSS setup? [[User:Sohom Datta|<b class="skin-invert" style="color:#795cb2; display: inline-block; transform: rotate(0.3deg)">Sohom</b>]] ([[User talk:Sohom Datta|<span class="skin-invert" style="color: #36c;">talk</span>]]) 06:59, 6 July 2026 (UTC) :@[[User:Sohom Datta|Sohom Datta]], after taking a step back and reviewing the entire context, I've decided to cancel this edit request. :To be completely honest, I got a bit caught up in the technical challenge of handling the legacy inline backgrounds via CSS, but looking at the bigger picture, the proposed fix ('color: inherit !important') is essentially just trading one forced behavior for another (six of one, half a dozen of the other). :While it fixes the aesthetics of the title on its own subject page, it completely wipes out the distinct link states that Yodin originally mentioned (the native browser handling of visited vs. unvisited links). A global CSS module isn't the right place to hardcode this, as it overrules the MediaWiki parser's native intelligence regarding '.mw-selflink' and link states. :Since this requires a more architectural fix rather than just patch-work on this specific stylesheet, I am marking this request as answered/cancelled. Thanks for taking the time to look into it! --[[User:GKNishimoto|GKNishimoto]] ([[User talk:GKNishimoto|talk]]) 11:12, 6 July 2026 (UTC)
Summary:
Please note that all contributions to TDG Encyclopedia may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
TDG Encyclopedia:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)