Edge Rewrite
// HTMLRewriter · presentation

This page was redesigned at the edge.

Cloudflare fetched the original article and streamed it through HTMLRewriter to apply an entirely new visual system without rebuilding the source page.

Jump to content

Template talk:Collapsible list

Page contents not supported in other languages.
Add topic
From Wikipedia, the free encyclopedia
Latest comment: 2 minutes ago by GuesanLoyalist in topic Deprecate "background:transparent"

Title invisible in infoboxes when in dark mode

[edit]

I'm not familiar enough with MediaWiki's source code to figure out where exactly this goes wrong, so I don't know where to file a bug.

Due to the rule

@media screen and (prefers-color-scheme: dark) {
  html.skin-theme-clientpref-os .mw-parser-output [style*="background"] {
    color: #202122;
  }
}

the color of collapsible list title text exactly matches the background of infoboxes (var(--background-color-interactive-subtle)) when using dark mode. This makes the title invisible in dark mode when this template is used within an infobox. Other text in infoboxes, if anything, has color: inherit !important, or uses a suitable var(--color-*). -- Stiiin (talk) 17:18, 5 December 2024 (UTC)Reply

Support for parameters from template hidden

[edit]

This could have support for some parameters used in template hidden so that same module could be used for both (and replace need for second template). It seems headerstyle and contentstyle are only fields that might be needed to add support (alternate names for parameters)? Ipr1 (talk) 14:35, 3 February 2025 (UTC)Reply

Errors

[edit]

@Zackmann08: Some articles such as Sahara have an infobox showing "Lua error in Module:Collapsible_list at line 142: attempt to call method 'expandTemplate' (a nil value)". That is because the new code in Module:Collapsible list calls frame:expandTemplate but frame is actually a table, not a Scribunto frame. The table is values which comes from {{Infobox valley}} which invokes Module:Compact list which calls clist(values) where clist = require('Module:Collapsible list').main. I'm not sure what to do about that. Probably start by reverting the change to this module then try mw.getCurrentFrame in the sandbox. Johnuniq (talk) 06:22, 2 February 2026 (UTC)Reply

Facepalm Facepalm @Johnuniq: thanks for the ping. No easy solution here... Will investigate further. For now have reverted. --Zackmann (Talk to me/What I been doing) 06:26, 2 February 2026 (UTC)Reply
Oh, I just tried a solution and didn't notice your revert. A diff of my edit will be a bit extreme because I cleaned the whitespace at the same time. Have a look at what I did and see if it works. Johnuniq (talk) 06:29, 2 February 2026 (UTC)Reply
That confused the hell out of me! But it looks like your fix did it. I'm not seeing any errors any more. Sorry I missed that... Didn't consider the case of another module calling Module:Collapsible list... Just thought about {{Collapsible list}}. I'll be offline for a bit pretty soon, but if any other issues pop up, let me know! Zackmann (Talk to me/What I been doing) 06:31, 2 February 2026 (UTC)Reply
No problem. Johnuniq (talk) 06:48, 2 February 2026 (UTC)Reply

@Mr. Stradivarius: Just curious: Your original version of this module (July 2013) has some code that is still present:

for k, v in pairs( frame.args ) do
    origArgs = frame.args
    break
end

Is that doing something clever that a plain

origArgs = frame.args

would not? Johnuniq (talk) 06:48, 2 February 2026 (UTC)Reply

Hmmm, I guess the current code only executes origArgs = frame.args if frame.args is not empty. Johnuniq (talk) 07:02, 2 February 2026 (UTC)Reply
@Johnuniq: Yes, I think the intention was to use the frame args if any are present, and if not, use the parent frame args. — Mr. Stradivarius  talk  02:47, 14 February 2026 (UTC)Reply

Deprecate "background:transparent"

[edit]

For context: I use dark mode on wikipedia as it's more easier on my eyes and whenever I would see a collapsible list with the background:transparent thing in it, it makes the title invisible. Highlighting the text can work on what the text would mean, but it's something that shouldn't be done in the first place for convience sake.

Secondly, the "background" (whom I'd assume to be of the text) is always transparent, so adding "background:transparent" would be already pointless to begin with. And thirdly, the problem isn't prevalent to be see whenever I switch to light mode, which would mean that said problem is unnecessarily discriminating on dark mode users.

Courtesy ping for @Closed Limelike Curves, Stiiin, Ipr1, Johnuniq, Zackmann08, and Mr. Stradivarius: GuesanLoyalist (talk) 09:33, 8 August 2026 (UTC)Reply

You are right, this should be largely removed from where it is still being used to fix dark mode. Ipr1 (talk) 17:23, 8 August 2026 (UTC)Reply
I don't see the string "transparent" in the module that this template uses. Is there a specific code change that you are hoping for? The general advice to avoid using background:none or background:transparent has been at the MediaWiki dark mode info page since 2024. – Jonesey95 (talk) 19:36, 8 August 2026 (UTC)Reply
Try this then? GuesanLoyalist (talk) 00:01, 9 August 2026 (UTC)Reply
It has been used in the past, at least some other language wikis still use old version. However, transparent might be present in other templates where it is inherited to collapsible list and appears in that case. So the cause might be elsewhere and those should be fixed as well. Ipr1 (talk) 21:42, 9 August 2026 (UTC)Reply
Doesn't the template use various modules and subparts? We'll might have to take a lot of time to find the problem. GuesanLoyalist (talk) 23:30, 9 August 2026 (UTC)Reply
This one does not. You can search for "module" in this code to look at references to other modules, and there is the CSS page (also listed in documentation). Template that uses this is only a wrapper to the Lua invoke. Problem that you describe is likely inherited from somewhere else. Ipr1 (talk) 10:44, 11 August 2026 (UTC)Reply
Have you looked at the style parameters given to template/module? Problem might be in the caller (not callee) using weird styles. Where do you see this issue specifically? Ipr1 (talk) 10:46, 11 August 2026 (UTC)Reply
Various places, you could search up my username with the search term "dark mode" and you should see it. But the tool's currently down right now. GuesanLoyalist (talk) 11:14, 11 August 2026 (UTC)Reply