Page MenuHomePhabricator

[Spike] Explore generic night-mode overrides for OOUI
Closed, DeclinedPublic

Description

Background

During T363861, we discovered that it is possible to target all OOUI interface and force them into light-mode, potentially improving legibility during the night-mode beta release phase. Long-term, we would prefer to have these interfaces support night-mode, so the goal of this investigation is to explore a generic short-term solution to prevent white-on-white or black-on-black text in existing OOUI products.

A POC patch and patchdemo have been produced to illustrate this approach. In general, it would involve including generic OOUI selectors alongside the .notheme class in Vector and potentially MinervaNeue:
e.g:

Vector/resources/CSSCustomProperties.less
:root,
.skin-invert,
.notheme,
.oo-ui-window, /*targeting  all OOUI modals*/
.oo-ui-widget:not(.mw-changeslist, .mw-body-content) { /*targeting all OOUI widgets except changelist, etc. */
    .cdx-mode-reset();
}

This approach is an alternative to using the .notheme class across many repos and the potential benefit would be not having to add the same class across many repos, saving us clean-up work in the long-run.

POC patch: https://gerrit.wikimedia.org/r/c/mediawiki/skins/Vector/+/1029674
patchdemo: https://patchdemo.wmflabs.org/wikis/d7552cee1b/wiki/Main_Page

User story

  • As a user enabling the night-mode beta feature, I would prefer that my editor-focused workflows remain legible.

The following are example on beta cluster where OOUI interfaces are illegible:

Screenshot 2024-05-14 at 9.52.59 AM.png (2×3 px, 941 KB)
Screenshot 2024-05-13 at 6.17.15 PM.png (2×3 px, 958 KB)
Screenshot 2024-05-14 at 9.55.08 AM.png (990×1 px, 126 KB)
Screen Shot 2024-05-13 at 3.25.38 PM.png (432×986 px, 33 KB)
newcomer homepageRecent changesAdvanced searchpopup notifications

Acceptance criteria

This spike should answer the following questions:

  • Is this a viable short-term solution for getting OOUI to work in dark-mode?
  • Can we use generic OOUI selectors with this approach, or is it better to target specific extensions? (If it's better to target extensions, then should we just use the notheme class instead?)
  • Should we pursue this approach?

Event Timeline

Jdlrobson triaged this task as Medium priority.May 15 2024, 12:19 AM

We should consider this approach in relation to disabling night-mode on entire pages. If many of these OOUI issues are on pages that have night mode disabled during the beta release, then this kind of approach might not be necessary (could still be useful for certain edge cases though).

Jdlrobson subscribed.

We are pushing ahead with T363849 so hopefully no need for this. We can reopen if we hit some blockers doing that.