You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by GitBox <gi...@apache.org> on 2021/02/01 09:11:39 UTC

[GitHub] [superset] villebro commented on a change in pull request #12858: feat(style-theme): add support for custom superset themes

villebro commented on a change in pull request #12858:
URL: https://github.com/apache/superset/pull/12858#discussion_r567659533



##########
File path: superset-frontend/src/preamble.ts
##########
@@ -74,3 +75,8 @@ setupColors(extraCategoricalColorSchemes, extraSequentialColorSchemes);
 
 // Setup number formatters
 setupFormatters();
+
+export const customTheme = merge(
+  supersetTheme,
+  bootstrapData?.common?.custom_theme ?? {},
+);

Review comment:
       Since this is merging into `supersetTheme`, it's not really the `custom_theme`, but rather a combination of both. Could this just be `theme`?

##########
File path: superset/config.py
##########
@@ -382,11 +382,29 @@ def _try_json_readsha(  # pylint: disable=unused-argument
 #          ['#006699', '#009DD9', '#5AAA46', '#44AAAA', '#DDAA77', '#7799BB', '#88AA77',
 #          '#552288', '#5AAA46', '#CC7788', '#EEDD55', '#9977BB', '#BBAA44', '#DDCCDD']
 #     }]
-#
 
 # This is merely a default
 EXTRA_CATEGORICAL_COLOR_SCHEMES: List[Dict[str, Any]] = []
 
+# CUSTOM_THEME is used for adding custom theme to superset
+# example code for "My theme" custom scheme
+# CUSTOM_THEME = {
+#   "borderRadius": 4,
+#   "colors": {
+#     "primary": {
+#       "base": 'red',
+#     },
+#     "secondary": {
+#       "base": 'green',
+#     },
+#     "grayscale": {
+#       "base": 'orange',
+#     }
+#   }
+# }
+
+CUSTOM_THEME = {}

Review comment:
       I'd prefer to call this `THEME_OVERRIDES` to highlight that it gets merged into the theme.




----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org