Commit 24e3af3c authored by Kushal Pandya's avatar Kushal Pandya

Merge branch 'ph/fixThemeColorMetaTag' into 'master'

Change meta tag theme color to match theme

See merge request gitlab-org/gitlab!63648
parents fef1f9ac 493e5b79
......@@ -66,6 +66,10 @@ module PreferencesHelper
@user_application_theme_css_filename ||= Gitlab::Themes.for_user(current_user).css_filename
end
def user_theme_primary_color
Gitlab::Themes.for_user(current_user).primary_color
end
def user_color_scheme
Gitlab::ColorSchemes.for_user(current_user).css_class
end
......
......@@ -71,7 +71,7 @@
= action_cable_meta_tag
%meta{ name: 'viewport', content: 'width=device-width, initial-scale=1, maximum-scale=1' }
%meta{ name: 'theme-color', content: '#474D57' }
%meta{ name: 'theme-color', content: user_theme_primary_color }
-# Apple Safari/iOS home screen icons
= favicon_link_tag 'touch-icon-iphone.png', rel: 'apple-touch-icon'
......
......@@ -10,21 +10,21 @@ module Gitlab
APPLICATION_DEFAULT = 1
# Struct class representing a single Theme
Theme = Struct.new(:id, :name, :css_class, :css_filename)
Theme = Struct.new(:id, :name, :css_class, :css_filename, :primary_color)
# All available Themes
THEMES = [
Theme.new(1, 'Indigo', 'ui-indigo', 'theme_indigo'),
Theme.new(6, 'Light Indigo', 'ui-light-indigo', 'theme_light_indigo'),
Theme.new(4, 'Blue', 'ui-blue', 'theme_blue'),
Theme.new(7, 'Light Blue', 'ui-light-blue', 'theme_light_blue'),
Theme.new(5, 'Green', 'ui-green', 'theme_green'),
Theme.new(8, 'Light Green', 'ui-light-green', 'theme_light_green'),
Theme.new(9, 'Red', 'ui-red', 'theme_red'),
Theme.new(10, 'Light Red', 'ui-light-red', 'theme_light_red'),
Theme.new(2, 'Dark', 'ui-dark', 'theme_dark'),
Theme.new(3, 'Light', 'ui-light', 'theme_light'),
Theme.new(11, 'Dark Mode (alpha)', 'gl-dark', nil)
Theme.new(1, 'Indigo', 'ui-indigo', 'theme_indigo', '#292961'),
Theme.new(6, 'Light Indigo', 'ui-light-indigo', 'theme_light_indigo', '#4b4ba3'),
Theme.new(4, 'Blue', 'ui-blue', 'theme_blue', '#1a3652'),
Theme.new(7, 'Light Blue', 'ui-light-blue', 'theme_light_blue', '#2261a1'),
Theme.new(5, 'Green', 'ui-green', 'theme_green', '#0d4524'),
Theme.new(8, 'Light Green', 'ui-light-green', 'theme_light_green', '#156b39'),
Theme.new(9, 'Red', 'ui-red', 'theme_red', '#691a16'),
Theme.new(10, 'Light Red', 'ui-light-red', 'theme_light_red', '#a62e21'),
Theme.new(2, 'Dark', 'ui-dark', 'theme_dark', '#303030'),
Theme.new(3, 'Light', 'ui-light', 'theme_light', '#666'),
Theme.new(11, 'Dark Mode (alpha)', 'gl-dark', nil, '#303030')
].freeze
# Convenience method to get a space-separated String of all the theme
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment