Page MenuHomePhabricator

Main pages should work in night mode
Closed, ResolvedPublic2 Estimated Story Points

Description

Context:
Per the most recent color contrast checker run, one of the top color contrast WCAG violation (at about 237 violations in the top 100 most popular pages in English Wikipedia) can be found within the text elements in .div.MainPageBG.mp-box

Issue Details:
Skin: Minerva (Night Mode)
Problem Area: Main Page

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:
Screenshot of color contrast issues in .mp-box.

Screenshot 2024-02-15 at 2.17.07 PM.png (1×2 px, 1 MB)

Proposed solution

For now we will add the following rule (and associated skin-night-mode-clientpref-2 @prefers media query):

.skin-night-mode-clientpref-1 .page-Main_Page .mw-parser-output * {
    background: inherit !important;
    color: inherit !important;
    border-color: var(--border-color-subtle) !important;
}

TODO

  • The styles should live in skins.minerva.mainPage.styles and only apply when wgMinervaApplyKnownTemplateHacks is enabled.
  • Use a common mixin night-mode-strip-colors() for consistency with the existing night-mode-invert()

Additional QA (exploratory)

  • Check other main pages on other projects

QA Results - Beta

ACStatusDetails
1T357722#9612250

QA Results - Prod

ACStatusDetails
1T357722#9632476 T357722#9635260

Related Objects

StatusSubtypeAssignedTask
Resolvedovasileva
Resolvedovasileva
Resolvedovasileva
ResolvedJdlrobson
Resolvedovasileva
Resolvedovasileva
ResolvedJScherer-WMF
Resolvedovasileva
ResolvedSpikeSToyofuku-WMF
Resolvedovasileva
ResolvedJdrewniak
ResolvedJScherer-WMF
Resolvedovasileva
ResolvedJdlrobson
Resolvedovasileva
ResolvedVolker_E
Resolvedovasileva
Resolvedovasileva
Resolvedovasileva
Resolvedovasileva
Resolvedovasileva
ResolvedFeatureNone
OpenNone
Resolvedovasileva
Resolvedovasileva
Resolvedovasileva
Resolvedovasileva
Resolvedovasileva

Event Timeline

Jdlrobson updated the task description. (Show Details)
Jdlrobson renamed this task from Color contrast issue with main page div.MainPageBG.mp-box to Main pages should work in night mode.Feb 21 2024, 11:11 PM
Jdlrobson updated the task description. (Show Details)
Jdlrobson added a subscriber: ovasileva.

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

[mediawiki/skins/MinervaNeue@master] Main page should work in night mode

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

Change 1007425 merged by jenkins-bot:

[mediawiki/skins/MinervaNeue@master] Main page should work in night mode

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

Jdlrobson added subscribers: Edtadros, Jdlrobson.

I realize this is also applying to links.

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

[mediawiki/skins/MinervaNeue@master] Don't strip colors from links in main page

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

Change 1008511 merged by jenkins-bot:

[mediawiki/skins/MinervaNeue@master] Don't strip colors from links

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

Jdlrobson lowered the priority of this task from High to Medium.
Jdlrobson added a subscriber: Jdrewniak.
ovasileva raised the priority of this task from Medium to High.Mar 5 2024, 4:38 PM

Test Result - Beta

Status: ❓Need More Info
Environment: enbeta, arbeta, eobeta, esbeta
OS: macOS Sonoma
Browser: Chrome
Device: MBA
Emulated Device:NA

Test Artifact(s):

QA Steps

❓ AC1: Check main pages and verify there are no contrast errors on WCAG Contrast Checker
The table below is a sample of a few main page types on Beta. the EN page passes just fine. The rest have issues. I'm not failing it because those elements may be out of scope.

statuswikimain page
en
screenshot 634.png (3×2 px, 1 MB)
ar
screenshot 631.png (1×1 px, 146 KB)
eo
screenshot 635.png (1×2 px, 758 KB)
es
screenshot 636.png (2×2 px, 943 KB)

@Edtadros to test other main pages you can follow the links in the language button at the bottom of the page.

Test Result - Beta

Status: ✅ Pass ❓Need More Info
Environment: various beta wikis
OS: macOS Sonoma
Browser: Chrome
Device: MBA
Emulated Device:NA

Test Artifact(s):

QA Steps

AC1: On English beta click the Language button. Check the main pages of each language in the language panel while in Night Mode, and verify there are no contrast errors on WCAG Contrast Checker.
@Jdlrobson, The only issue is on Russian beta wiki. If the element that fails is out of scope let me know and I'll pass this.

statuslanguagewikimain page
Englishen
screenshot 637 en.png (3×2 px, 1 MB)
Catalàca
screenshot 637 ca.png (2×2 px, 641 KB)
Deutchde
screenshot 637 de.png (3×2 px, 833 KB)
Españoles
screenshot 637 es.png (1×2 px, 329 KB)
Esperantoeo
screenshot 637 eo.png (1×2 px, 551 KB)
Qafár afaa
screenshot 637 aa.png (1×2 px, 327 KB)
Shqipsq
screenshot 637 sq.png (4×2 px, 1 MB)
Simple EnglishsimpleThis is a very long screenshot...not so much a mystery.
screenshot 637 simple.png (8×2 px, 2 MB)
Svenskasv
screenshot 637 sv.png (1×2 px, 574 KB)
Русскийru
screenshot 637 ru2.png (453×1 px, 132 KB)
screenshot 637 ru 1.png (8×2 px, 3 MB)
This passes per T357722#9612538
Українськаuk
screenshot 637 uk.png (1×2 px, 568 KB)
עבריתhe
screenshot 637 he.png (1×2 px, 303 KB)
العربيةar
screenshot 637 ar.png (1×2 px, 489 KB)
فارسیfa
screenshot 637 fa.png (1×2 px, 353 KB)
हिन्दीhi
screenshot 637 hi.png (1×2 px, 555 KB)
中文zh
screenshot 637 zh.png (6×2 px, 2 MB)
日本語ja
screenshot 637 ja.png (1×2 px, 573 KB)
한국어ko
screenshot 637 ko.png (1×2 px, 317 KB)

Russian is a pass. The only issues I see are with flagged revisions and banners.

Screenshot 2024-03-07 at 9.39.09 AM.png (247×1 px, 29 KB)

Looks good to me as well. Resolving.

Test Result - Prod

Status: ❌ Fail
Environment: various wikis
OS: macOS Sonoma
Browser: Chrome
Device: MBA
Emulated Device:NA

Test Artifact(s):

QA Steps

❌ AC1: On English wiki click the Language button. Check the main pages of each language in the language panel while in Night Mode, and verify there are no contrast errors on WCAG Contrast Checker.
@Jdlrobson, I ran the WCAG on the main pages from the language button. the ones with ❌ have some failures. Please let me know if you'd like to close this as verified.

statuslanguagewikimain pagescreenshot
1Indonesianidhttps://id.m.wikipedia.org/wiki/?minervanightmode=1
screenshot_id.png (1×1 px, 482 KB)
2 ❌Malaymshttps://ms.m.wikipedia.org/wiki/?minervanightmode=1
screenshot_ms.png (1×1 px, 366 KB)
screenshot.png (1×1 px, 309 KB)
screenshot 1.png (1×1 px, 321 KB)
3Bosnianbshttps://bs.m.wikipedia.org/wiki/?minervanightmode=1
screenshot_bs.png (1×1 px, 583 KB)
4Catalancahttps://ca.m.wikipedia.org/wiki/?minervanightmode=1
screenshot_ca.png (1×1 px, 742 KB)
5Danishdahttps://da.m.wikipedia.org/wiki/?minervanightmode=1
screenshot_da.png (1×1 px, 637 KB)
6Germandehttps://de.m.wikipedia.org/wiki/?minervanightmode=1
screenshot_de.png (1×1 px, 553 KB)
7Estonianethttps://et.m.wikipedia.org/wiki/?minervanightmode=1
screenshot_et.png (1×1 px, 549 KB)
8Spanisheshttps://es.m.wikipedia.org/wiki/?minervanightmode=1
screenshot_es.png (1×1 px, 619 KB)
9 ❌Esperantoeohttps://eo.m.wikipedia.org/wiki/?minervanightmode=1
screenshot_eo.png (1×1 px, 552 KB)
screenshot.png (1×1 px, 534 KB)
screenshot 1.png (1×1 px, 534 KB)
screenshot 3.png (1×1 px, 545 KB)
screenshot 2.png (1×1 px, 535 KB)
10Basqueeuhttps://eu.m.wikipedia.org/wiki/?minervanightmode=1
screenshot_eu.png (1×1 px, 664 KB)
11Frenchfrhttps://fr.m.wikipedia.org/wiki/?minervanightmode=1
screenshot_fr.png (1×1 px, 534 KB)
12Galicianglhttps://gl.m.wikipedia.org/wiki/?minervanightmode=1
screenshot_gl.png (1×1 px, 735 KB)
13❌Croatianhrhttps://hr.m.wikipedia.org/wiki/?minervanightmode=1
screenshot_hr.png (1×1 px, 642 KB)
screenshot 2.png (1×1 px, 626 KB)
screenshot 1.png (1×1 px, 625 KB)
screenshot.png (1×1 px, 625 KB)
14Italianithttps://it.m.wikipedia.org/wiki/?minervanightmode=1
screenshot_it.png (1×1 px, 557 KB)
15Latvianlvhttps://lv.m.wikipedia.org/wiki/?minervanightmode=1
screenshot_lv.png (1×1 px, 563 KB)
16Lithuanianlthttps://lt.m.wikipedia.org/wiki/?minervanightmode=1
screenshot_lt.png (1×1 px, 625 KB)
17 ❌Hungarianhuhttps://hu.m.wikipedia.org/wiki/?minervanightmode=1
screenshot_hu.png (1×1 px, 644 KB)
screenshot.png (1×1 px, 627 KB)
18 ❌Dutchnlhttps://nl.m.wikipedia.org/wiki/?minervanightmode=1
screenshot_nl.png (1×1 px, 479 KB)
screenshot 4.png (1×1 px, 555 KB)
screenshot 3.png (1×1 px, 485 KB)
screenshot 2.png (1×1 px, 464 KB)
19Norwegian Bokmålnbhttps://no.m.wikipedia.org/wiki/?minervanightmode=1
screenshot_nb.png (1×1 px, 509 KB)
20Norwegian Nynorsknnhttps://nn.m.wikipedia.org/wiki/?minervanightmode=1
screenshot_nn.png (1×1 px, 520 KB)
21Polishplhttps://pl.m.wikipedia.org/wiki/?minervanightmode=1
screenshot_pl.png (1×1 px, 695 KB)
22Portuguesepthttps://pt.m.wikipedia.org/wiki/?minervanightmode=1
screenshot_pt.png (1×1 px, 624 KB)
23Romanianrohttps://ro.m.wikipedia.org/wiki/?minervanightmode=1
screenshot_ro.png (1×1 px, 489 KB)
24Simple Englishen-simplehttps://simple.m.wikipedia.org/wiki/?minervanightmode=1
screenshot_en-simple.png (1×1 px, 537 KB)
25Slovakskhttps://sk.m.wikipedia.org/wiki/?minervanightmode=1
screenshot_sk.png (1×1 px, 538 KB)
26Slovenianslhttps://sl.m.wikipedia.org/wiki/?minervanightmode=1
screenshot_sl.png (1×1 px, 687 KB)
27Serbo-Croatianshhttps://sh.m.wikipedia.org/wiki/?minervanightmode=1
screenshot_sh.png (1×1 px, 571 KB)
28Finnishfihttps://fi.m.wikipedia.org/wiki/?minervanightmode=1
screenshot_fi.png (1×1 px, 545 KB)
29Swedishsvhttps://sv.m.wikipedia.org/wiki/?minervanightmode=1
screenshot_sv.png (1×1 px, 617 KB)
30 ❌Vietnamesevihttps://vi.m.wikipedia.org/wiki/?minervanightmode=1
screenshot_vi.png (1×1 px, 631 KB)
screenshot 1.png (1×1 px, 460 KB)
screenshot.png (1×1 px, 585 KB)
31Turkishtrhttps://tr.m.wikipedia.org/wiki/?minervanightmode=1
screenshot_tr.png (1×1 px, 479 KB)
32Czechcshttps://cs.m.wikipedia.org/wiki/?minervanightmode=1
screenshot_cs.png (1×1 px, 721 KB)
33Greekelhttps://el.m.wikipedia.org/wiki/?minervanightmode=1
screenshot_el.png (1×1 px, 471 KB)
34Bulgarianbghttps://bg.m.wikipedia.org/wiki/?minervanightmode=1
screenshot_bg.png (1×1 px, 564 KB)
35Macedonianmkhttps://mk.m.wikipedia.org/wiki/?minervanightmode=1
screenshot_mk.png (1×1 px, 557 KB)
36 ❌Russianruhttps://ru.m.wikipedia.org/wiki/?minervanightmode=1
screenshot_ru.png (1×1 px, 601 KB)
screenshot.png (1×1 px, 583 KB)
37Serbiansrhttps://sr.m.wikipedia.org/wiki/?minervanightmode=1
screenshot_sr.png (1×1 px, 603 KB)
38 ❌Ukrainianukhttps://uk.m.wikipedia.org/wiki/?minervanightmode=1
screenshot_uk.png (1×1 px, 565 KB)
screenshot 1.png (1×1 px, 549 KB)
screenshot.png (1×1 px, 550 KB)
39Hebrewhehttps://he.m.wikipedia.org/wiki/?minervanightmode=1
screenshot_he.png (1×1 px, 609 KB)
40 ❌Arabicarhttps://ar.m.wikipedia.org/wiki/?minervanightmode=1
screenshot_ar.png (1×1 px, 597 KB)
screenshot.png (1×1 px, 615 KB)
41Persianfahttps://fa.m.wikipedia.org/wiki/?minervanightmode=1
screenshot_fa.png (1×1 px, 631 KB)
42Central Kurdishckbhttps://ckb.m.wikipedia.org/wiki/?minervanightmode=1
screenshot_ckb.png (1×1 px, 541 KB)
43Banglabnhttps://bn.m.wikipedia.org/wiki/?minervanightmode=1
screenshot_bn.png (1×1 px, 681 KB)
44Thaithhttps://th.m.wikipedia.org/wiki/?minervanightmode=1
screenshot_th.png (1×1 px, 628 KB)
45 ❌Georgiankahttps://ka.m.wikipedia.org/wiki/?minervanightmode=1
screenshot_ka.png (1×1 px, 765 KB)
screenshot.png (1×1 px, 627 KB)
46 ❌Chinesezhhttps://zh.m.wikipedia.org/wiki/?minervanightmode=1
screenshot_zh.png (1×1 px, 606 KB)
screenshot.png (1×1 px, 627 KB)
47Japanesejahttps://ja.m.wikipedia.org/wiki/?minervanightmode=1
screenshot_ja.png (1×1 px, 752 KB)
48 ❌Koreankohttps://ko.m.wikipedia.org/wiki/?minervanightmode=1
screenshot_ko.png (1×1 px, 448 KB)
screenshot 2.png (1×1 px, 434 KB)
screenshot.png (1×1 px, 431 KB)

The attached zip file contains the macOS automator workflow and data file used to capture the 1st image of the main pages in the table above. You will have to open the WCAG manually the first time.

Test Result - Prod

Status: ✅ PASS / Attention
Environment: various wikis
OS: macOS Sonoma
Browser: Chrome
Device: MBA
Emulated Device:NA

Test Artifact(s):

QA Steps

✅ AC1: On English wiki click the Language button. Check the main pages of each language in the language panel while in Night Mode, and verify there are no contrast errors on WCAG Contrast Checker.
As per T357722#9634945, only ka and ko had issues. But since they are going to be addressed by different tasks I will pass them. I did want to draw your attention to the ones with a below. They pass based on the scope of this task, but they have black elements that were not caught by the WCAG CC that are difficult to see.

statuslanguagewikimain pagescreenshot
2 ✅Malaymshttps://ms.m.wikipedia.org/wiki/?minervanightmode=1
screenshot_ms.png (1×1 px, 359 KB)
9 ✅Esperantoeohttps://eo.m.wikipedia.org/wiki/?minervanightmode=1
screenshot_eo.png (1×1 px, 541 KB)
13 ✅Croatianhrhttps://hr.m.wikipedia.org/wiki/?minervanightmode=1
screenshot_hr.png (1×1 px, 568 KB)
17 ✅Hungarianhuhttps://hu.m.wikipedia.org/wiki/?minervanightmode=1
screenshot_hu.png (1×1 px, 746 KB)
18 ✅Dutchnlhttps://nl.m.wikipedia.org/wiki/?minervanightmode=1
screenshot_nl.png (1×1 px, 460 KB)
30 ✅Vietnamesevihttps://vi.m.wikipedia.org/wiki/?minervanightmode=1
screenshot_vi.png (1×1 px, 619 KB)
36 ✅Russianruhttps://ru.m.wikipedia.org/wiki/?minervanightmode=1
screenshot_ru.png (1×1 px, 600 KB)
38 ✅Ukrainianukhttps://uk.m.wikipedia.org/wiki/?minervanightmode=1
screenshot_uk.png (1×1 px, 556 KB)
40 Arabicarhttps://ar.m.wikipedia.org/wiki/?minervanightmode=1
screenshot_ar.png (1×1 px, 610 KB)
The Facebook logo is different than the other social media icons. The large arabic writing in black actually is hard to see, the dropshadow on it makes it harder.
45 ✅Georgiankahttps://ka.m.wikipedia.org/wiki/?minervanightmode=1
screenshot.png (1×1 px, 698 KB)
WCAG issues addressed per T357722#9634945
46 ✅Chinesezhhttps://zh.m.wikipedia.org/wiki/?minervanightmode=1
screenshot_zh.png (1×1 px, 661 KB)
48 Koreankohttps://ko.m.wikipedia.org/wiki/?minervanightmode=1
screenshot_ko.png (1×1 px, 445 KB)
WCAG issues addressed per T357722#9634945
screenshot 1.png (1×1 px, 441 KB)
This is another situation where the WCAG checker didn't flag the black on night mode icons/images.
Edtadros updated the task description. (Show Details)