Page MenuHomePhabricator

Update thumbnail styling for better dark mode legibility
Closed, ResolvedPublic2 Estimated Story PointsBUG REPORT

Description

NOTE: This should not be worked on until T387543 is resolved.

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

What happens?:
Images use a fixed background color #c8ccd1 defined in Vector (https://gerrit.wikimedia.org/g/mediawiki/skins/Vector/+/df3e7fb3efa87111fd9de4cf23cb73f606993497/resources/skins.vector.styles/media.less#19)
and in Minerva (https://gerrit.wikimedia.org/g/mediawiki/skins/MinervaNeue/+/14ce43900462a0f82053afd084b9962896c1d068/resources/skins.minerva.styles/content/images.less#131)

What should have happened instead?:

    • The images should be identical on mobile and desktop
  • Following input from DST on T387543 the images should be updated to use a fixed white background (@background-color-base-fixed) in both dark and light mode
  • In dark mode the images should also receive a filter: brightness(0.8);
  • Light mode should not be impacted by our changes.

Software version (on Special:Version page; skip for WMF-hosted wikis like Wikipedia):

Other information (browser name/version, screenshots, etc.):

Requirement

Improve thumbnail styling for dark mode to ensure consistent appearance across desktop and mobile. Update styles to use a fixed white background and apply a brightness filter in dark mode, while preserving the current appearance in light mode.

BDD

Feature: Update thumbnail styling for dark mode legibility  

  Scenario: Thumbnails render consistently across skins  
    Given I view a thumbnail image in light or dark mode  
    Then the thumbnail has a white background  
    And it looks visually consistent across Minerva and Vector skins  

  Scenario: Thumbnails are filtered in dark mode for legibility  
    Given I view a page in dark mode  
    When I view a thumbnail  
    Then the thumbnail has a brightness filter applied  

  Scenario: Light mode appearance remains unchanged  
    Given I view a page in light mode  
    Then the thumbnail displays as it did previously

Test Steps

Test Case 1: Verify thumbnails use white background and brightness filter in dark mode (Vector)

  1. Enable dark mode on desktop using Vector skin.
  2. Visit: https://en.wikipedia.org/wiki/Wikipedia:Village_pump_(technical)/Archive_218#Thumbnail_background
  3. Locate a thumbnail image.
  4. AC1: Confirm the background is white.
  5. AC2: Confirm a brightness(0.8) filter is applied.

Test Case 2: Verify thumbnails use white background and brightness filter in dark mode (Minerva)

  1. Enable dark mode on mobile (or emulate mobile view).
  2. Visit: https://en.m.wikipedia.org/wiki/Wikipedia:Village_pump_(technical)/Archive_218#Thumbnail_background
  3. Scroll to a thumbnail.
  4. AC3: Confirm the background is white.
  5. AC4: Confirm a brightness(0.8) filter is applied.

Test Case 3: Verify light mode is unaffected

  1. Disable dark mode (return to light mode).
  2. Visit either desktop or mobile version of the above article.
  3. AC5: Confirm thumbnail styling remains unchanged from the previous behavior.

QA Results - Beta

QA Results - Beta

In event of rollback, it's important not to revert 588efdff805. Reverting the Vector and Minerva changes should be sufficient.

Event Timeline

For consistency, the scope is actually broader than the title says:

  1. The same background should be used for all image formats supporting transparency (PNG, GIF, what else?), not only SVGs.
  2. There should be an option to apply the filter regardless of transparency (particularly, to images with opaque white background).
Jdlrobson-WMF changed the task status from Stalled to In Progress.Mar 12 2025, 10:07 PM
Jdlrobson-WMF claimed this task.
Jdlrobson-WMF moved this task from Freezer to Q3 on the Web-Team board.

Proposing for Q3 given this is now unblocked given feedback from DST.

Jdlrobson-WMF renamed this task from Update thumbnail handling in dark mode of transparent SVGs to Update thumbnail styling.Mar 12 2025, 10:32 PM
Jdlrobson-WMF updated the task description. (Show Details)

Change #1127112 had a related patch set uploaded (by Jdlrobson; author: Bartosz Dziewoński):

[mediawiki/core@master] Set thumbnail image background to @background-color-base-fixed (white)

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

Jdlrobson-WMF renamed this task from Update thumbnail styling to Update thumbnail styling for better dark mode legibility.Mar 12 2025, 10:33 PM
Jdlrobson-WMF changed the task status from In Progress to Open.Mar 14 2025, 4:46 PM
Jdlrobson-WMF set the point value for this task to 2.

Change #1131462 had a related patch set uploaded (by Jdlrobson; author: Jdlrobson):

[mediawiki/core@master] SkinModule: Add dark mode styles for images

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

Change #1131463 had a related patch set uploaded (by Jdlrobson; author: Jdlrobson):

[mediawiki/skins/MinervaNeue@master] Use core styles for image styling in dark mode

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

Change #1131464 had a related patch set uploaded (by Jdlrobson; author: Jdlrobson):

[mediawiki/skins/Vector@master] Use core styles for image styling in dark mode

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

Will find a code reviewer for remaining patches tomorrow.

Jdlrobson-WMF raised the priority of this task from Medium to High.Mar 26 2025, 11:54 PM

Change #1127112 merged by jenkins-bot:

[mediawiki/core@master] Set thumbnail image background to @background-color-base-fixed (white)

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

Change #1131462 merged by jenkins-bot:

[mediawiki/core@master] SkinModule: Add dark mode styles for images

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

Change #1131464 merged by jenkins-bot:

[mediawiki/skins/Vector@master] Use core styles for image styling in dark mode

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

Change #1131463 merged by jenkins-bot:

[mediawiki/skins/MinervaNeue@master] Use core styles for image styling in dark mode

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

Edtadros subscribed.

Test Steps

Status: ✅ PASS / ❓Need More Info
Environment: Beta
OS: macOS
Browser: Chrome
Device: MS

Test Case 1: Verify thumbnails use white background and brightness filter in dark mode (Vector)

  1. Enable dark mode on desktop using Vector skin.
  2. Visit: https://en.wikipedia.org/wiki/Wikipedia:Village_pump_(technical)/Archive_218#Thumbnail_background
  3. Locate a thumbnail image.
  4. ✅AC1: Confirm the background is white.
  5. ✅AC2: Confirm a brightness(0.8) filter is applied.

screenshot 217.png (1×1 px, 429 KB)

Test Case 2: Verify thumbnails use white background and brightness filter in dark mode (Minerva)

  1. Enable dark mode on mobile (or emulate mobile view).
  2. Visit: https://en.m.wikipedia.org/wiki/Wikipedia:Village_pump_(technical)/Archive_218#Thumbnail_background
  3. Scroll to a thumbnail.
  4. ✅AC3: Confirm the background is white.

screenshot 218.png (1×1 px, 404 KB)

  1. ❓AC4: Confirm a brightness(0.8) filter is applied.

Could not confirm the brightness

Test Case 3: Verify light mode is unaffected

  1. Disable dark mode (return to light mode).
  2. Visit either desktop or mobile version of the above article.
  3. ✅ AC5: Confirm thumbnail styling remains unchanged from the previous behavior.

screenshot 219.png (755×1 px, 215 KB)

screenshot 221.png (760×1 px, 286 KB)

Test Steps

Status: ❌ FAIL
Environment: Beta
OS: macOS
Browser: Chrome
Device: MS

Test Case 1: Verify thumbnails use white background and brightness filter in dark mode (Vector)

  1. Enable dark mode on desktop using Vector skin.
  2. Visit: https://en.wikipedia.org/wiki/Wikipedia:Village_pump_(technical)/Archive_218#Thumbnail_background
  3. Locate a thumbnail image.
  4. ✅AC1: Confirm the background is white.
  5. ✅AC2: Confirm a brightness(0.8) filter is applied.

screenshot 246.png (1×1 px, 466 KB)

Test Case 2: Verify thumbnails use white background and brightness filter in dark mode (Minerva)

  1. Enable dark mode on mobile (or emulate mobile view).
  2. Visit: https://en.m.wikipedia.org/wiki/Wikipedia:Village_pump_(technical)/Archive_218#Thumbnail_background
  3. Scroll to a thumbnail.
  4. ❌ AC3: Confirm the background is white.

screenshot 247.png (1×1 px, 451 KB)

  1. ❓AC4: Confirm a brightness(0.8) filter is applied.

Could not confirm the brightness

Test Case 3: Verify light mode is unaffected

  1. Disable dark mode (return to light mode).
  2. Visit either desktop or mobile version of the above article.
  3. ⬜ AC5: Confirm thumbnail styling remains unchanged from the previous behavior.

screenshot 248.png (1×1 px, 459 KB)

screenshot 249.png (1×1 px, 465 KB)