Page MenuHomePhabricator

Dark mode sometimes yields illegible transparent-background SVGs on mouse-over article previews
Closed, ResolvedPublic1 Estimated Story PointsBUG REPORT

Description

Steps to replicate the issue (include links if applicable):

image.png (768×1 px, 175 KB)

  • Use #c8ccd1 for the background, do not use a CSS variable for this (see resources/skins.vector.styles/media.less for approach for images in article)

Derived Requirement

Ensure that SVG images with transparent backgrounds displayed in article previews on hover in dark mode have a visible background color (#c8ccd1), without using a CSS variable, to improve legibility.

BDD

gherkin
Feature: Legibility of Transparent-background SVGs in Dark Mode on Article Previews

Scenario: Display SVG images with a visible background color in dark mode article previews
  Given a user has enabled dark mode on the website
  And an article preview contains an SVG image with a transparent background
  When the user hovers over the article preview
  Then the background color of the SVG should be #c8ccd1 to improve legibility

Test Result - Beta|Prod

Status: ✅ PASS / ❓Need More Info / ❌ FAIL
Environment: beta/testwiki
OS: macOS Sonoma 15.0
Browser: Chrome 130
Device: MBA
Emulated Device: NA

Test Artifact(s):

Test Steps

Test Case 1: Verify Background Color of Transparent SVGs in Dark Mode

  1. Enable dark mode on Wikipedia.
  2. Navigate to Hydrogen chloride article.
  3. Hover over the article preview containing an SVG image with a transparent background.
  4. ✅❓❌⬜ AC1: Confirm that the SVG image background is displayed with the color #c8ccd1, making it legible in dark mode.

QA Results - Beta

ACStatusDetails
1T375045#10298169

QA Results - PROD

ACStatusDetails
1T375045#10314222

Event Timeline

Jdlrobson triaged this task as Medium priority.Sep 18 2024, 3:21 PM
Jdlrobson added a project: Web-Team-Backlog.
Jdlrobson subscribed.

Thanks for the report!

The issue is repeated in the actual page, again the SVG is hard to read against the off-black background.

image.png (720×908 px, 110 KB)

The issue is repeated in the actual page, again the SVG is hard to read against the off-black background.

image.png (720×908 px, 110 KB)

For the issue in article content, please use the talk page of the template to report that issue - an editor will need to fix it. Please point them to https://www.mediawiki.org/wiki/Recommendations_for_night_mode_compatibility_on_Wikimedia_wikis
The bug you reported for page previews is valid though and we'll look into it.

You're right--looks like it's template:chembox's fault.
Cheers!

For what it's worth, the preview for ISBN appears brown (but mostly imperceptible) in its preview.

SToyofuku-WMF subscribed.

Holding onto this as a potential onboarding task

The patch https://gerrit.wikimedia.org/r/c/mediawiki/extensions/Popups/+/1084907 was merged (didn't get picked up and report here due to a new line in the commit message)

@Jdlrobson Do you know of any beta or test site that I can test this on?

@Jdlrobson Thanks for the Beta link!

Test Result - Beta

Status: ✅ PASS
Environment: Beta
OS: macOS Sonoma 15.0
Browser: Chrome 130
Device: MBA
Emulated Device: NA

Test Artifact(s):

https://en.wikipedia.beta.wmflabs.org/wiki/T375045

Test Steps

Test Case 1: Verify Background Color of Transparent SVGs in Dark Mode

  1. Enable dark mode on Wikipedia.
  2. Navigate to T375045.
  3. Hover over the article preview containing an SVG image with a transparent background.
  4. AC1: Confirm that the SVG image background is displayed with the color #c8ccd1, making it legible in dark mode.

2024-11-06_16-17-42.png (1×1 px, 467 KB)

GMikesell-WMF assigned this task to ovasileva.
GMikesell-WMF updated the task description. (Show Details)

Test Result - PROD

Status: ✅ PASS
Environment: PROD
OS: macOS Sonoma 15.0
Browser: Chrome 130
Device: MBA
Emulated Device: NA

Test Artifact(s):

https://en.wikipedia.org/wiki/Hydrogen_chloride#Organic_synthesis

Test Steps

Test Case 1: Verify Background Color of Transparent SVGs in Dark Mode

  1. Enable dark mode on Wikipedia.
  2. Navigate to https://en.wikipedia.org/wiki/Hydrogen_chloride#Organic_synthesis.
  3. Hover over the article preview containing an SVG image with a transparent background.
  4. AC1: Confirm that the SVG image background is displayed with the color #c8ccd1, making it legible in dark mode.

2024-11-12_11-00-23.png (1×1 px, 409 KB)