Page MenuHomePhabricator

WCAG Color Contrast Violations in Infobox on Minerva Skin Night Mode
Closed, ResolvedPublic3 Estimated Story Points

Description

NOTE: For issues with signatures see T359587
NOTE: For issues with style="background" see T358797
NOTE: For issues with non-standard infoboxes see T359644

Context:
Per the most recent color contrast checker run, the topmost common color contrast WCAG violation (at about 5000+ violations in the top 100 most popular pages in English Wikipedia) can be found within the text elements in the infobox.

Issue Details:
Skin: Minerva (Night Mode)
Problem Area: infobox

Steps to Reproduce:

Expected Result:
The text and background colors within the infobox should have a WCAG 2.0 level AA contrast ratio of at least 4.5:1 for normal text and 3:1 for large text.

Actual Result:

Foreground ColorBackground ColorContrastAA
#EAECF0#F8F9FA1.12No
#6699FF#F8F9FA2.63No
#FFA500#F8F9FA1.87No

Screenshot 2024-02-13 at 1.00.35 PM.png (1×640 px, 328 KB)

Screenshot 2024-02-13 at 1.00.17 PM.png (1×638 px, 328 KB)

Screenshot 2024-02-13 at 1.01.17 PM.png (1×632 px, 186 KB)

  • Proposed solution **
  • Any infobox element using a style attribute and background or using a known header class should inherit background from the article.
  • The styles should live in skins.minerva.base.styles/common/hacks.less
mw.util.addCSS(`
.infobox-above,
/* itwiki */.sinottico th,
.infobox-header {
  &:not( .notheme ) {
    background-color: var(--background-color-base) !important;
    background: var(--background-color-base) !important;
    color: var(--color-base) !important; 
  } 
}`)
  • It should be possible for editors to opt out of the overrides by appending a notheme class to their HTML.

QA

  1. Visit https://sh.m.wikipedia.org/wiki/Carles_Puigdemont?minervanightmode=1
  2. Expected:

Screenshot 2024-02-21 at 4.11.38 PM.png (1×656 px, 652 KB)

  1. Visit https://it.m.wikipedia.org/wiki/Stato_Pontificio?minervanightmode=1
  2. Expected:

Screenshot 2024-02-21 at 4.12.53 PM.png (1×648 px, 213 KB)

  1. Visit https://zh.m.wikipedia.org/wiki/%E6%9E%97%E5%8D%83%E5%8F%88?minervanightmode=1
  2. Expected: Readable infobox

(For now, french wikipedia is expected to fail QA)

  1. Visit https://fr.m.wikipedia.org/wiki/Bob_Marley?minervanightmode=1
  2. Expected: Readable infobox with no background colors
  1. https://fr.m.wikipedia.org/w/index.php?title=Zin%C3%A9dine_Zidane&minervanightmode=1
  2. Expected: Readable infobox with no background colors
  1. Check colors appear for all the above pages in light mode

QA Results - Beta

ACStatusDetails
1T357453#9613733

QA Results - Prod

Related Objects

Event Timeline

Jdlrobson changed the task status from Open to Stalled.Feb 15 2024, 6:43 PM
Jdlrobson subscribed.

This is currently fixed on beta cluster: https://en.m.wikipedia.beta.wmflabs.org/w/index.php?title=Dog&minervanightmode=1 so hopefully nothing to do here for Minerva. We may need to repurpose it for desktop though.

There are likely to be a few follow up issues relating to elements inside infoboxes e.g. https://sh.m.wikipedia.org/wiki/Carles_Puigdemont?minervanightmode=1 and https://it.m.wikipedia.org/wiki/Stato_Pontificio?minervanightmode=1 that we may want to do additional work for.

The proposed solution here would be to make the background color of known headers match the color-subtle of the article background.
e.g.
{F42029288}

Jdlrobson changed the task status from Stalled to Open.Feb 22 2024, 12:04 AM
ovasileva set the point value for this task to 3.Feb 29 2024, 5:42 PM

Change 1008567 had a related patch set uploaded (by Stoyofuku-wmf; author: Stoyofuku-wmf):

[mediawiki/skins/MinervaNeue@master] Strip color from infoboxes in night mode

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

Change 1008567 merged by jenkins-bot:

[mediawiki/skins/MinervaNeue@master] Strip color from infoboxes in night mode

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

@SToyofuku-WMF let's use our one on one tomorrow to decide if we should expand the amount of infoboxes we target!

@ovasileva to add steps for testing across all pilot wikis

Italian Wikipedia is looking great. We dropped from 4292 violations to 3075 and no infobox issues.

I've asked Steph to look into extending our night mode checker to check for color contrast issues across multiple issues to see how other projects are faring with the new rule. As a starting point we can check the 95 different language versions of https://en.m.wikipedia.org/wiki/Nicki_Minaj.

SToyofuku-WMF updated Other Assignee, added: Jdlrobson.
SToyofuku-WMF updated the task description. (Show Details)
SToyofuku-WMF moved this task from Doing to QA on the Web-Team-Backlog (FY2023-24 Q3 Sprint 4) board.

Test Result - Beta

Status: ✅ PASS
Environment: beta
OS: macOS Sonoma
Browser: Chrome
Device: MBA
Emulated Device:NA

Test Artifact(s):

QA Steps

Enable night mode in the Minerva skin.
Observe the color contrast within the infobox content.
✅ AC1: The text and background colors within the infobox should have a WCAG 2.0 level AA contrast ratio of at least 4.5:1 for normal text and 3:1 for large text.
The contrast checker errors are not related to the infobox.

screenshot 645.png (1×681 px, 342 KB)

screenshot 646.png (1×681 px, 318 KB)

Jdlrobson added a subscriber: Edtadros.

I can sign this off - I need to check which projects did not benefit from the fix (other than French)

Test Result - Prod

Status: ❌ FAIL
Environment: shwiki, itwiki, zhwiki, frwiki
OS: macOS Sonoma
Browser: Chrome
Device: MBA
Emulated Device:NA

Test Artifact(s):

QA Steps

Visit https://sh.m.wikipedia.org/wiki/Carles_Puigdemont?minervanightmode=1
❌ AC1: The text and background colors within the infobox should have a WCAG 2.0 level AA contrast ratio of at least 4.5:1 for normal text and 3:1 for large text.

screenshot 650.png (1×1 px, 325 KB)

Visit https://it.m.wikipedia.org/wiki/Stato_Pontificio?minervanightmode=1
✅ AC2: There are no WCAG errors and it is readable.
screenshot 651.png (9×2 px, 3 MB)

Visit https://zh.m.wikipedia.org/wiki/%E6%9E%97%E5%8D%83%E5%8F%88?minervanightmode=1
✅ AC3: Expected: Readable infobox
screenshot 652.png (670×1 px, 266 KB)

(For now, french wikipedia is expected to fail QA)

Visit https://fr.m.wikipedia.org/wiki/Bob_Marley?minervanightmode=1
⬜ AC4: Expected: Readable infobox with no background colors

screenshot 653.png (953×1 px, 441 KB)

https://fr.m.wikipedia.org/w/index.php?title=Zin%C3%A9dine_Zidane&minervanightmode=1
⬜ AC5: Readable infobox with no background colors

screenshot 654.png (4×2 px, 2 MB)

✅ AC5: Check colors appear for all the above pages in light mode

screenshot 655.png (10×1 px, 2 MB)
screenshot 656.png (9×1 px, 2 MB)
screenshot 657.png (816×1 px, 359 KB)
screenshot 658.png (1×1 px, 479 KB)
screenshot 659.png (3×2 px, 3 MB)

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

[mediawiki/skins/MinervaNeue@master] Force color and background rules in night mode for infoboxes

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

Change 1009781 merged by jenkins-bot:

[mediawiki/skins/MinervaNeue@master] Force color and background rules in night mode for infoboxes

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

Jdlrobson closed this task as Resolved.EditedMar 8 2024, 6:55 PM

French was expected to fail. I've opened T359644 to capture that. I pointed the color contrast at the 272 language versions of the Paris Wikipedia article to find other issues, and folded them into that ticket.

While doing this testing I noticed a few other issues which are addressed by https://gerrit.wikimedia.org/r/1009781
We'll QA those in T359658.

I've reached out to the Serbian community via Discord to address the issue with https://sh.m.wikipedia.org/wiki/Carles_Puigdemont?minervanightmode=1

I only see hacks.less getting bigger and this will surely complicate fixes in the long term. How easily should itwiki (and all projects) know that one of its CSS classes is hard-corrected in MediaWiki?

Hi @Lofhi we have a plan for that. In future this will be customizable per wiki T358071 so wikis will be able to turn off the styles that do not apply. The amount of rules we have in their is more or less what we will eventually ship with. We will not be shipping styles for less-widely used templates.