mistercrunch commented on code in PR #35220:
URL: https://github.com/apache/superset/pull/35220#discussion_r2371333438
##########
superset-frontend/src/theme/ThemeController.ts:
##########
@@ -698,18 +743,38 @@ export class ThemeController {
* Applies the current theme configuration to the global theme.
* This method sets the theme on the globalTheme and applies it to the Theme.
* It also handles any errors that may occur during the application of the
theme.
- * @param theme - The theme configuration to apply
+ * @param theme - The theme configuration to apply (may already include base
theme tokens)
*/
private applyTheme(theme: AnyThemeConfig): void {
try {
const normalizedConfig = normalizeThemeConfig(theme);
+
+ // Simply apply the theme - it should already be properly merged if
needed
+ // The merging with base theme happens in getThemeForMode() and other
methods
+ // that prepare themes before passing them to applyTheme()
this.globalTheme.setConfig(normalizedConfig);
} catch (error) {
console.error('Failed to apply theme:', error);
this.fallbackToDefaultMode();
}
}
+ /**
+ * Determines if a theme configuration is for dark mode.
+ * @param theme - The theme configuration to check
+ * @returns True if the theme is dark mode, false otherwise
+ */
+ private isThemeDark(theme: AnyThemeConfig): boolean {
Review Comment:
already exists in packages/superset-ui-core/src/theme/utils/themeUtils.ts
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]