Page MenuHomePhabricator

DarkMode: Create a mechanism to activate dark mode within the extension
Open, Needs TriagePublic5 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?]

Event Timeline

Mooeypoo created this task.May 3 2019, 5:55 PM
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptMay 3 2019, 5:55 PM
Restricted Application added a project: Community-Tech. · View Herald TranscriptMay 3 2019, 6:04 PM
jmatazzoni updated the task description. (Show Details)
MaxSem updated the task description. (Show Details)May 6 2019, 11:45 PM
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)
MusikAnimal moved this task from Ready to In Development on the Community-Tech-Sprint board.

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

jmatazzoni removed MusikAnimal as the assignee of this task.May 9 2019, 5:21 PM