Page MenuHomePhabricator

Sitelink badges (wb-badges-default.svg) are invisible in dark mode
Closed, ResolvedPublic

Description

In dark mode, you cannot see the icon for setting the badges for sitelinks.

This is because the badge is set as a background-image (SVG) in jquery.wikibase.sitelinkview.less and has a #000 fill colour.

Steps to reproduce:

Acceptance criteria:

  • The badge icon is visible in both light and dark mode

Notes:
See e.g. this change for how we fixed this for other icons by turning them into masks.

Details

Event Timeline

Hoping I picked the right Wikibase component, appologies if I didn't.

A quick fix to not make it completely invisible would be to make the image dark grey instead of completely black.

Tarrow subscribed.

Looks to me like this is probably in the Omega Team's area

We fixed this for various other SVGs by turning them into masks (see e.g. this change), should be doable here I think.

@Lokal_Profil: can you share some links where the issue can be seen? Because there are at least 2, probably 3 (not sure) places where Wikibase defines badges (on the item view, either from Wikibase or from WikimediaBadges, and on client wikis), and it would be good to know which one is affected ^^

Ollie.Shotton_WMDE renamed this task from wb-badges-default.svg invisible in dark mode to Sitelink badges (wb-badges-default.svg) are invisible in dark mode.Jul 29 2025, 10:12 AM
Ollie.Shotton_WMDE updated the task description. (Show Details)

Okay, I can confirm it affects at least the UI to edit sitelink badges on the main item page (e.g. Q42), with the wikibase-sitelinkview-badges class name. If it affects other places as well, please say so or open another task :)

image.png (272×578 px, 43 KB)

UX question (cc @Alice.moutinho): previously, the badge icon here was perfectly black (#000), but now we need a Codex token for it. There’s no pure black in the Codex colors – is it okay to change that icon to one of color-base or color-emphasized, or do we need some hack to make it perfectly black or white?

Change #1178573 had a related patch set uploaded (by Lucas Werkmeister (WMDE); author: Lucas Werkmeister (WMDE)):

[mediawiki/extensions/Wikibase@master] Fix empty badge for dark mode

https://gerrit.wikimedia.org/r/1178573

Also, should we update any of the other badges to also use color tokens? There’s the ones used on Wikidata (light and dark mode), and then also the one shipped by Wikidata as a default (I don’t think that one can be seen anywhere in Wikimedia production or on the Beta cluster, so I don’t know how to demo it). All of them use colors other than black, so I think they don’t look too horrible in dark mode, but perhaps we still want to change them.

Change #1178573 merged by jenkins-bot:

[mediawiki/extensions/Wikibase@master] Fix empty badge for dark mode

https://gerrit.wikimedia.org/r/1178573