Skip to content

Draft: Start to decouple dark mode from nav theme

Simon Knox requested to merge psi-dark-nav-science into master

What does this MR do and why?

Contrast theme

Test out separating dark mode from nav themes. Add theme user preference

Also adds experimental 'System' theme option!

Todos:

  • rename ColorMode to ContrastTheme or ContrastMode
  • use enum instead of plain strings for names
  • split up this MR
  • backwards-compatible FE changes first
  • Add feature flag
  • Change gl-dark selector to use data attributes, allow automatic mode

later:

  • Rename Theme to NavTheme
  • Rename ColorScheme to something with "SyntaxHighlighting" in the name

Screenshots or screen recordings

dark

Screen_Recording_2022-10-14_at_12.59.31_pm

How to set up and validate locally

  1. run migration
  2. Toggle light/dark
  3. Check different nav themes work

Todos and difficulties

  1. The 'theme' is currently just a string of light/dark. We probably want some model like for nav themes
  2. The name 'theme' is already taken by nav themes. Can we rename these to navigation_themes? Is that too much hassle?
  3. Needs migration for users with dark mode theme currently to dark / dark themes
Edited by Simon Knox

Merge request reports