Skip to content

Add default option for Syntax Highlighting Theme user setting

Colin Berry requested to merge colin969/gitlab:default_syntax_theme into master

What does this MR do and why?

Adds default_syntax_highlighting_theme config option to change the default syntax highlighting theme, similair to the already existing default_theme option.

Pairing both options makes a default dark theme with matching default syntax highlighting theme possible, the previously unchangeable default light syntax theme would clash horribly.

Added documentation to the Application Settings API for default_syntax_highlighting_theme.

Solves #25129 (closed)

Screenshots

If an anonymous user visits GitLab and the default_theme has been set to Dark Mode, then the syntax highlighting will clash since it defaults to light. This does not impact existing user preferences, only those visitors and new users.

Before After
Screen_Shot_2023-02-06_at_10.27.37 Screen_Shot_2023-02-06_at_10.28.15

How to set up and validate locally

  1. Change the default_syntax_highlighting_theme to 2 via the application settings API
  2. Create a new user and impersonate them
  3. Verify that the syntax highlighting theme is set to Dark on their preferences page

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Peter Leitzen

Merge request reports