msyavuz commented on code in PR #35220:
URL: https://github.com/apache/superset/pull/35220#discussion_r2371960466
##########
superset-frontend/packages/superset-ui-core/src/theme/types.ts:
##########
@@ -78,6 +78,7 @@ export type SerializableThemeConfig = {
algorithm?: ThemeAlgorithmOption;
hashed?: boolean;
inherit?: boolean;
+ cssVar?: boolean | { key?: string; prefix?: string };
Review Comment:
I am not sure what this is
##########
superset-frontend/src/theme/ThemeController.ts:
##########
@@ -572,6 +589,30 @@ export class ThemeController {
);
}
+ /**
+ * Checks if a theme is truly empty (not even an algorithm).
+ * A theme with just an algorithm is still valid and should be used.
+ */
+ private isEmptyTheme(theme: any): boolean {
+ if (!theme) return true;
+
+ // If it's an empty object {}, it's empty
+ if (typeof theme === 'object' && Object.keys(theme).length === 0)
+ return true;
+
+ // If theme has an algorithm, it's not empty (even without tokens)
+ if (theme.algorithm) return false;
+
+ // Check if theme has any tokens defined
+ if (theme.token && Object.keys(theme.token).length > 0) return false;
+
+ // Check if theme has components defined
+ if (theme.components && Object.keys(theme.components).length > 0)
+ return false;
+
+ return true;
+ }
Review Comment:
This doesn't look right to me, can we add proper types to the argument?
First two checks might not be needed
--
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]