diff --git a/web/components/UserProfile.ce.vue b/web/components/UserProfile.ce.vue index 8b6983e20..176cb9039 100644 --- a/web/components/UserProfile.ce.vue +++ b/web/components/UserProfile.ce.vue @@ -120,7 +120,7 @@ onMounted(() => { • - + {{ name }} { - + diff --git a/web/components/UserProfile/ServerState.vue b/web/components/UserProfile/ServerState.vue index f98388616..983a645c8 100644 --- a/web/components/UserProfile/ServerState.vue +++ b/web/components/UserProfile/ServerState.vue @@ -21,7 +21,7 @@ const upgradeAction = computed((): ServerStateDataAction | undefined => { diff --git a/web/store/theme.ts b/web/store/theme.ts index 3dc953c84..fe0813414 100644 --- a/web/store/theme.ts +++ b/web/store/theme.ts @@ -74,6 +74,39 @@ export const defaultColors: Record = { }, } as const; +/** + * Unraid default theme colors do not have consistent colors for the header. + * This is a workaround to set the correct colors for the header. + * DARK THEMES: black, gray + * DARK HEADER THEMES: white, gray + * LIGHT THEMES: white, gray + * LIGHT HEADER THEMES: black, gray + */ +export const defaultAzureGrayHeaderColors: ThemeVariables = { // azure and gray header colors are the same but the background color is different + '--header-text-primary': '#39587f', + '--header-text-secondary': '#606e7f', +}; +export const defaultHeaderColors: Record = { + azure: { + ...defaultAzureGrayHeaderColors, + '--header-background-color': '#1c1b1b', + }, + black: { + '--header-text-primary': '#1c1c1c', + '--header-text-secondary': '#999999', + '--header-background-color': '#f2f2f2', + }, + gray: { + ...defaultAzureGrayHeaderColors, + '--header-background-color': '#f2f2f2', + }, + white: { + '--header-text-primary': '#f2f2f2', + '--header-text-secondary': '#999999', + '--header-background-color': '#1c1b1b', + }, +}; + // used to swap the UPC text color when using the azure or gray theme export const DARK_THEMES = ['black', 'gray'] as const; @@ -81,9 +114,12 @@ export const useThemeStore = defineStore('theme', () => { // State const theme = ref(); - const activeColorVariables = ref(defaultColors.light); - // Getters + const activeColorVariables = ref({ + ...defaultColors.light, + ...defaultHeaderColors['white'], + }); + // Getters const darkMode = computed( () => DARK_THEMES.includes(theme.value?.name as (typeof DARK_THEMES)[number]) ?? false ); @@ -106,6 +142,15 @@ export const useThemeStore = defineStore('theme', () => { const body = document.body; const selectedMode = darkMode.value ? 'dark' : 'light'; + // set the default header colors for the current theme + const themeName = theme.value?.name; + if (themeName && themeName in defaultHeaderColors) { + customColorVariables[selectedMode] = { + ...customColorVariables[selectedMode], + ...defaultHeaderColors[themeName], + }; + } + // overwrite with hex colors set in webGUI @ /Settings/DisplaySettings if (theme.value?.textColor) { customColorVariables[selectedMode]['--header-text-primary'] = theme.value.textColor;