feat(branding): force color mode (dark or light) site-wide

This commit is contained in:
Luca
2026-05-05 16:06:38 +02:00
parent 114aab5777
commit 5a162fc8be
11 changed files with 211 additions and 21 deletions
@@ -19,6 +19,12 @@ export interface PublicSettings {
branding_logo_display_header?: boolean;
branding_logo_display_hero?: boolean;
branding_hide_powered_by?: boolean;
/**
* Force the entire site into a specific color mode (instance-wide).
* 'dark' or 'light' override user/system preference; null = no force.
* AdminDarkModeContext + ThemeContext both honor this.
*/
branding_force_color_mode?: 'dark' | 'light' | null;
theme_config: any;
default_language: string;
enable_analytics: boolean;
+12 -1
View File
@@ -19,6 +19,12 @@ export interface BrandingSettings {
logo_display_hero?: boolean;
logo_display_mode?: 'logo_only' | 'text_only' | 'logo_and_text';
hide_powered_by?: boolean;
/**
* Force the entire admin and public site into a specific color mode.
* When set, the user-facing dark/light toggle is hidden and any per-theme
* `colorMode` override is ignored. `null` means no force (default behavior).
*/
force_color_mode?: 'dark' | 'light' | null;
}
export interface ThemeSettings {
@@ -288,7 +294,12 @@ export const settingsService = {
logo_display_header: this._parseBoolean(rawSettings.branding_logo_display_header, true),
logo_display_hero: this._parseBoolean(rawSettings.branding_logo_display_hero, true),
logo_display_mode: rawSettings.branding_logo_display_mode || 'logo_and_text',
hide_powered_by: this._parseBoolean(rawSettings.branding_hide_powered_by, false)
hide_powered_by: this._parseBoolean(rawSettings.branding_hide_powered_by, false),
force_color_mode: rawSettings.branding_force_color_mode === 'dark'
? 'dark'
: rawSettings.branding_force_color_mode === 'light'
? 'light'
: null
};
},