Page MenuHomePhabricator

Update MobileFrontend codebase to use CSS variables
Closed, ResolvedPublic3 Estimated Story Points

Description

MobileFrontend's component library should be update to use CSS variables. Note anything using OOUI or Codex should be considered out of scope - we should focus on colors defined in MobileFrontend.

QA

Check the following appear in a night-mode like theme:

Sign off

  • Note any components that use OOUi or Codex components and check we have follow up tickets to address them.

QA Results - Beta

QA Results - Prod

Event Timeline

Jdlrobson set the point value for this task to 3.Feb 1 2024, 6:49 PM
SToyofuku-WMF subscribed.

Putting down for now to work on the fixes for T356825 - will pick up again if nobody else does but didn't want to hold onto it in case someone else want to take it

Nvm, will pick this back up while I wait for clarification on the above (probably prioritizing the other one over this, but I am actively working on both)

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

[mediawiki/extensions/MobileFrontend@master] First pass at replacing hardcoded colors with LESS variables

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

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

[mediawiki/extensions/MobileFrontend@master] Replace #72777d with @color-subtle

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

Change 1003869 merged by jenkins-bot:

[mediawiki/extensions/MobileFrontend@master] First pass at replacing hardcoded colors with LESS variables

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

(Posting here as I'm about to take off for a week and Justin is working on a more pressing matter, so let's have the discussion async and in public so it can be handed off easier)

We've got a couple more questions about visual changes that could affect day mode in the process of completing this ticket:

The first is around the hex code #72777d, which is hardcoded in a number of locations across the codebase. Looking at the codex design token definitions, there are a few variables we could use but none of them feel like the intended use of the variable (most instances of this value being hardcoded are for text color and most of the variables are for borders, etc). The variable that feels the most correct here is @color-base--subtle, which is marked as deprecated, with a comment to use @color-subtle instead, but a note that @color-subtle is using color.gray600 rather than color.gray500. Do you have an opinion on whether we should change these instances of #72777d in the codebase to use @color-subtle (in effect rewriting them to be #54595d, a shade darker) instead?

Second question is what you'd like us to do with the media viewer background in both day mode and night mode. Currently, the value is hardcoded to #000 and can be seen as the background here. In night mode, the background is still #000, as can be seen here (ignore the other styles, we haven't fixed those yet but will as part of this ticket). Do you have a sense of whether this background should be changed to use one of the codex variables, or how we'd like it to vary in night mode?

Thank you so much and sorry for another essay!!

Test wiki created on Patch demo by Jdlrobson using patch(es) linked to this task:
https://patchdemo.wmflabs.org/wikis/8f4f5289c9/w

The first is around the hex code #72777d, which is hardcoded in a number of locations across the codebase. Looking at the codex design token definitions, there are a few variables we could use but none of them feel like the intended use of the variable (most instances of this value being hardcoded are for text color and most of the variables are for borders, etc). The variable that feels the most correct here is @color-base--subtle, which is marked as deprecated, with a comment to use @color-subtle instead, but a note that @color-subtle is using color.gray600 rather than color.gray500. Do you have an opinion on whether we should change these instances of #72777d in the codebase to use @color-subtle (in effect rewriting them to be #54595d, a shade darker) instead?

Please use @color-subtle. That's no problem.

Second question is what you'd like us to do with the media viewer background in both day mode and night mode. Currently, the value is hardcoded to #000 and can be seen as the background here. In night mode, the background is still #000, as can be seen here (ignore the other styles, we haven't fixed those yet but will as part of this ticket). Do you have a sense of whether this background should be changed to use one of the codex variables, or how we'd like it to vary in night mode?

I'd like the image viewer and the citations drawer to have a #202122 background which is @color-base in day mode, but that would invert it in night mode, so let's just leave these for now. They still look ok in night mode with the #000 background.

Change 1003872 merged by jenkins-bot:

[mediawiki/extensions/MobileFrontend@master] Replace #72777d with @color-subtle

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

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

[mediawiki/skins/MinervaNeue@master] Map color-based skin variables to CSS variables

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

Jdlrobson added a subscriber: Edtadros.

When https://gerrit.wikimedia.org/r/c/mediawiki/skins/MinervaNeue/+/1003926 is merged the new MobileFrontend night theme should become enabled.

Change 1003926 merged by jenkins-bot:

[mediawiki/skins/MinervaNeue@master] Map color-based skin variables to CSS variables

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

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

[mediawiki/skins/MinervaNeue@master] Fixes typo

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

Jdlrobson added a subscriber: Jdrewniak.

Following the fix I'm seeing some issues in night mode with the search in light mode due to the new Codex mixin updates:

Screenshot 2024-02-20 at 5.54.12 PM.png (1×920 px, 205 KB)

Should be easy to fix. I'll take a look tomorrow.

There was also an issue in editor overlay due to a typo that will be fixed by https://gerrit.wikimedia.org/r/c/mediawiki/skins/MinervaNeue/+/1005210

Screenshot 2024-02-20 at 5.55.42 PM.png (510×1 px, 36 KB)

I suspect these will be flagged by Pixel shortly.

Change 1005210 merged by jenkins-bot:

[mediawiki/skins/MinervaNeue@master] Fixes typo

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

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

[mediawiki/extensions/MobileFrontend@master] Fixes search overlay icon

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

Change 1005522 had a related patch set uploaded (by Jdrewniak; author: Jdrewniak):

[mediawiki/skins/MinervaNeue@master] Follow-up to a30b575271 Map color-based skin variables to CSS variables

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

Change 1005214 merged by jenkins-bot:

[mediawiki/extensions/MobileFrontend@master] Fixes search overlay icon

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

Change 1005522 merged by jenkins-bot:

[mediawiki/skins/MinervaNeue@master] Follow-up to a30b575271 Map color-based skin variables to CSS variables

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

Test Result - Beta

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

Test Artifact(s):

QA Steps
NOTE: Please see AC5 before signing off.

Check the following appear in a night-mode like theme:

✅ AC1: Language overlay

screenshot 576.png (844×390 px, 47 KB)

✅ AC2: Search

screenshot 577.png (844×390 px, 81 KB)

✅ AC3: Reference drawer (click a reference)

screenshot 578.png (841×390 px, 120 KB)

✅ AC4 New link drawer (click a red link)

screenshot 579.png (841×390 px, 109 KB)

❓ AC5: Edit overlay (excluding any OOUI components)
The Edit overlay buttons do not appear in night mode. Edit summary screen does not appear in dark mode. The edit help overlay is only partially in night mode. If those three items are not considered in scope for the task then this is a pass.

screenshot 581.png (841×390 px, 100 KB)
screenshot 582.png (841×390 px, 83 KB)
screenshot 583.png (841×390 px, 66 KB)

✅ AC6: The user page https://m.mediawiki.org/wiki/User%3A89.22.234.115?minervanightmode=1

screenshot 585.png (841×390 px, 49 KB)

Edtadros updated the task description. (Show Details)
ovasileva claimed this task.

Test Result - Prod

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

Test Artifact(s):

QA Steps

Check the following appear in a night-mode like theme:

✅ AC1: Language overlay

screenshot 605.png (844×395 px, 24 KB)

✅ AC2: Search

screenshot 606.png (848×394 px, 13 KB)

✅ AC3: Reference drawer (click a reference)

screenshot 607.png (845×392 px, 97 KB)

✅ AC4 New link drawer (click a red link)

screenshot 608.png (845×392 px, 134 KB)

✅ AC5: Edit overlay (excluding any OOUI components)

screenshot 609.png (846×389 px, 73 KB)
screenshot 610.png (846×389 px, 26 KB)

✅ AC6: The user page https://m.mediawiki.org/wiki/User%3A89.22.234.115?minervanightmode=1

screenshot 611.png (846×389 px, 41 KB)