Commit 493e5b79 authored by Phil Hughes's avatar Phil Hughes

Change meta tag theme color to match theme

Changes the hardcoded theme-color meta tag
to match the primary color from the users selected theme.

Changelog: fixed
parent 04e26c94
...@@ -66,6 +66,10 @@ module PreferencesHelper ...@@ -66,6 +66,10 @@ module PreferencesHelper
@user_application_theme_css_filename ||= Gitlab::Themes.for_user(current_user).css_filename @user_application_theme_css_filename ||= Gitlab::Themes.for_user(current_user).css_filename
end end
def user_theme_primary_color
Gitlab::Themes.for_user(current_user).primary_color
end
def user_color_scheme def user_color_scheme
Gitlab::ColorSchemes.for_user(current_user).css_class Gitlab::ColorSchemes.for_user(current_user).css_class
end end
......
...@@ -71,7 +71,7 @@ ...@@ -71,7 +71,7 @@
= action_cable_meta_tag = action_cable_meta_tag
%meta{ name: 'viewport', content: 'width=device-width, initial-scale=1, maximum-scale=1' } %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 -# Apple Safari/iOS home screen icons
= favicon_link_tag 'touch-icon-iphone.png', rel: 'apple-touch-icon' = favicon_link_tag 'touch-icon-iphone.png', rel: 'apple-touch-icon'
......
...@@ -10,21 +10,21 @@ module Gitlab ...@@ -10,21 +10,21 @@ module Gitlab
APPLICATION_DEFAULT = 1 APPLICATION_DEFAULT = 1
# Struct class representing a single Theme # 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 # All available Themes
THEMES = [ THEMES = [
Theme.new(1, 'Indigo', 'ui-indigo', 'theme_indigo'), Theme.new(1, 'Indigo', 'ui-indigo', 'theme_indigo', '#292961'),
Theme.new(6, 'Light Indigo', 'ui-light-indigo', 'theme_light_indigo'), Theme.new(6, 'Light Indigo', 'ui-light-indigo', 'theme_light_indigo', '#4b4ba3'),
Theme.new(4, 'Blue', 'ui-blue', 'theme_blue'), Theme.new(4, 'Blue', 'ui-blue', 'theme_blue', '#1a3652'),
Theme.new(7, 'Light Blue', 'ui-light-blue', 'theme_light_blue'), Theme.new(7, 'Light Blue', 'ui-light-blue', 'theme_light_blue', '#2261a1'),
Theme.new(5, 'Green', 'ui-green', 'theme_green'), Theme.new(5, 'Green', 'ui-green', 'theme_green', '#0d4524'),
Theme.new(8, 'Light Green', 'ui-light-green', 'theme_light_green'), Theme.new(8, 'Light Green', 'ui-light-green', 'theme_light_green', '#156b39'),
Theme.new(9, 'Red', 'ui-red', 'theme_red'), Theme.new(9, 'Red', 'ui-red', 'theme_red', '#691a16'),
Theme.new(10, 'Light Red', 'ui-light-red', 'theme_light_red'), Theme.new(10, 'Light Red', 'ui-light-red', 'theme_light_red', '#a62e21'),
Theme.new(2, 'Dark', 'ui-dark', 'theme_dark'), Theme.new(2, 'Dark', 'ui-dark', 'theme_dark', '#303030'),
Theme.new(3, 'Light', 'ui-light', 'theme_light'), Theme.new(3, 'Light', 'ui-light', 'theme_light', '#666'),
Theme.new(11, 'Dark Mode (alpha)', 'gl-dark', nil) Theme.new(11, 'Dark Mode (alpha)', 'gl-dark', nil, '#303030')
].freeze ].freeze
# Convenience method to get a space-separated String of all the theme # 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