== Background & User story
Why are we doing this ticket?
- This ticket will be used to set up the feature flag for night mode on mobile (Minerva skin). The feature flag will help us and other teams with testing the feature in a production environment
How does it connect to our overall plans? What goal does it link to?
- See task tree
What previous/central documentation exists?
- https://www.mediawiki.org/wiki/Reading/Web/Accessibility_for_reading
== User Stories
As a WMF or community member, I would like the ability to test the current version of night mode on mobile so that it's easier for me to report and fix issues
== Requirements
- Set up a feature flag with url parameter on the Minerva skin
- Enabling the feature flag will add the night mode option menu {F39971911} (See {T349210} for details)
- The night mode setting will have 3 options
- Selecting night mode will turn night mode on
== Acceptance criteria
[] All product and design requirements above must be complete
[] The dark mode can be enabled via a ?minervadarkmode=1 parameter.
== Developer checklist
Complete before passing to QA:
[] When the feature flag is disabled, the class `skin-darkmode-0` is NOT present on the HTML element.
[] When the feature flag is enabled, but the user has opted out of night mode, the class `skin-darkmode-0` should be present on the HTML element.
[] When the feature flag is enabled, but the user has opted into night mode, the class `skin-darkmode-1` should be present on the HTML element.
[] When the feature flag is enabled, and the user has opted into "automatic" mode, the class `skin-darkmode-2` should be present on the HTML element.
[] The feature flag should be associated with a user preference
== QA steps
[] In production and the beta cluster with the feature flag disabled there should be no change to the color scheme of Minerva (mobile)
[] When you visit https://en.m.wikipedia.beta.wmflabs.org/w/index.php?title=Special:MobileOptions&returnto=T352930&minervanightmode=0 night mode should be off
[] When you visit https://en.m.wikipedia.beta.wmflabs.org/w/index.php?title=Special:MobileOptions&returnto=T352930&minervanightmode=1 night mode should be forced on
[] When you visit https://en.m.wikipedia.beta.wmflabs.org/w/index.php?title=Special:MobileOptions&returnto=T352930&minervanightmode=2 night mode should correspond with whatever is enabled at your operating system level.
Further QA is covered by steps in T350170 and T355065.
== Signoff criteria
* Create task to register the option in the MobileOptions page.