Page MenuHomePhabricator

DarkMode: Create a mechanism to activate dark mode within the extension
Closed, DeclinedPublic5 Estimated Story Points

Description

As we move forward with DarkMode, we're creating an extension. The skeleton (CI rules + base files + linting) should have happened on T221877: Create skeleton for Dark Mode extension

This ticket defines the base behavior of the extension itself, to enable the switching for users:

  • Create a beta preference that will be used to judge whether a user enabled DarkMode or not
  • (As we are testing this) Add a cookie check for logged out users [looks like we are probably not doing this, right @Mooeypoo ]
  • PHP: In the page rendering hook a condition whereby if the preference (or cookie) are true, the html class is added to <body> and the CSS style modules are attached
  • PHP: Allow for a temporary override of the cookie/preference state through the URL parameter ?usedarkmode=1. This should temporarily override (not actively change the value) of the cookie or preference for the immediate page load.
  • JS: Add basic toggle while we wait for the official design. NOTE: The toggle should lazy-load any necessary JS modules. [@Mooeypoo there was some discussion about whether this is the right way to go. Care to comment?]

Details

Event Timeline

MaxSem updated the task description. (Show Details)

We're going to discuss implementation details in a separate meeting.

jmatazzoni set the point value for this task to 5.
jmatazzoni updated the task description. (Show Details)

Change 508740 had a related patch set uploaded (by MusikAnimal; owner: MusikAnimal):
[mediawiki/extensions/DarkMode@master] Add CSS and toggling for dark mode

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

The first patch for this task is ready for review. Build is failing but maybe you can help me figure out why :)

Change 508740 merged by jenkins-bot:
[mediawiki/extensions/DarkMode@master] Add CSS and toggling for dark mode

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

This will not be deployed to WMF cluster. Many of the items on the checklist have been done. Those that have not and are desired should be made into new tasks.