Page MenuHomePhabricator

docs: Colors tokens page is always showing light mode values
Closed, ResolvedPublic1 Estimated Story PointsBUG REPORT

Description

Steps to replicate the issue (include links if applicable):

What happens?:

  • Toggling to dark mode should show dark mode variant of token values and previews

What should have happened instead?:

  • All token values and previews stay in their light mode variants

Thank you @LucasWerkmeister for raising this in T383606#10788738.


This is happening because we're relying on a property returned by VitePress's useData composable, isDark, which worked when we were using VitePress's color mode switcher. Now that we've using our own system where the color mode is stored in localStorage, we should update the colors page to use that data.


Acceptance criteria

  • Switching color mode also switches the color swatches and values on the Colors tokens page

Event Timeline

AnneT removed the point value 1 for this task.

Change #1141955 had a related patch set uploaded (by Anne Tomasevich; author: Anne Tomasevich):

[design/codex@main] docs: Sync VitePress's `isDark` ref with color mode switcher

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

I also discovered this while helping the Turkish wiki community adapt their templates to dark mode at Hackathon. Thanks to Lucas for reporting it!

Change #1141955 merged by jenkins-bot:

[design/codex@main] docs: Sync VitePress's `isDark` ref with color mode switcher

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

Seems to be working again on main \o/

Thanks for confirming (and for reporting this) @LucasWerkmeister!

Change #1148969 had a related patch set uploaded (by Eric Gardner; author: Eric Gardner):

[mediawiki/core@master] Update Codex from v2.0.0-rc.1 to v2.0.0-rc.2

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

Test wiki created on Patch demo by EGardner (WMF) using patch(es) linked to this task:
https://patchdemo.wmcloud.org/wikis/7aa598f12d/w/

Test wiki created on Patch demo by EGardner (WMF) using patch(es) linked to this task:
https://patchdemo.wmcloud.org/wikis/19abcf333d/w/

Test wiki on Patch demo by EGardner (WMF) using patch(es) linked to this task was deleted:

https://patchdemo.wmcloud.org/wikis/19abcf333d/w/

Test wiki created on Patch demo by EGardner (WMF) using patch(es) linked to this task:
https://patchdemo.wmcloud.org/wikis/b0226e7578/w/

Test wiki created on Patch demo by EGardner (WMF) using patch(es) linked to this task:
https://patchdemo.wmcloud.org/wikis/1711107665/w/

Test wiki created on Patch demo by Volker E. (WMF) using patch(es) linked to this task:
https://patchdemo.wmcloud.org/wikis/f6d7eb37f0/w/

Test wiki on Patch demo by EGardner (WMF) using patch(es) linked to this task was deleted:

https://patchdemo.wmcloud.org//wikis/1711107665/w/

Test wiki on Patch demo by EGardner (WMF) using patch(es) linked to this task was deleted:

https://patchdemo.wmcloud.org//wikis/7aa598f12d/w/

Test wiki on Patch demo by EGardner (WMF) using patch(es) linked to this task was deleted:

https://patchdemo.wmcloud.org//wikis/b0226e7578/w/

Test wiki on Patch demo by Volker E. (WMF) using patch(es) linked to this task was deleted:

https://patchdemo.wmcloud.org//wikis/f6d7eb37f0/w/