Decouple dark color mode from navigation themes
What does this MR do and why?
Requires !142772 (merged) to save color mode into color_mode_id
field in database. Also to migrate existing dark mode users with theme_id: 11
to color_mode_id: 2
.
Decouple dark color mode from navigation themes
- Add
color_mode_id
property to user preferences - Add user preferences section
- Add dark mode theme styles
Why this is important
- Add flexibility to dark mode: Users need flexibility to designate theme to visually distinguish GitLab, but dark mode was limiting the sidebar color possibilities.
- Abstract color modes towards design tokens: Initialise color modes as a modifier for design token modes in preparation of possible future high-contrast/dimmed etc. possible modes.
- Advancing dark mode: Assist in moving dark mode from alpha into a beta stage by introducing color modes.
MR acceptance checklist
Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.
Screenshots or screen recordings
CleanShot_2024-02-28_at_15.59.23
Indigo
Light Indigo
Blue
Light Blue
Green
Light Green
Red
Light Red
Gray
Neutral
How to set up and validate locally
On master
- View user preferences e.g. http://gdk.test:3000/-/profile/preferences
- Set theme to "Dark mode (Experiment)"
- This should set the
theme_id
to11
and verify when switching over to the updated branch that we automatically set:- the
color_mode_id
to2
for "Dark (Experimental)" and - the
theme_id
to3
for "Neutral"
- the
On MR branch
- View user preferences e.g. http://gdk.test:3000/-/profile/preferences
- Toggle "Appearance" between light and dark mode
- Toggle themes between modes
Related to #430061 (closed)
Edited by Jeremy Elder