Incubator-superset: How to customize the theme

Created on 20 Dec 2018  路  4Comments  路  Source: apache/incubator-superset

Make sure these boxes are checked before submitting your issue - thank you!

  • [ ] I have checked the superset logs for python stacktraces and included it here as text if there are any.
  • [ ] I have reproduced the issue with at least the latest released version of superset.
  • [ ] I have checked the issue tracker for the same issue and I haven't found one similar.

Superset version

Expected results

Actual results

Steps to reproduce

inactive

Most helpful comment

You essentially need to fork and make your own builds.

This is a good place to start:
https://github.com/apache/incubator-superset/blob/master/superset/assets/stylesheets/less/cosmo/variables.less

We serve a display page for the theme you can use while you tweak it: /superset/theme/

All 4 comments

You essentially need to fork and make your own builds.

This is a good place to start:
https://github.com/apache/incubator-superset/blob/master/superset/assets/stylesheets/less/cosmo/variables.less

We serve a display page for the theme you can use while you tweak it: /superset/theme/

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@mistercrunch does it make sense to have global CSSTemplates?
We can flag a CSS template as global and load it at "superset/basic.html" so it applies always. It allows basic theming without having to maintain a separate repository.

image

Then at the end of the head section:

{% for entry in global_css %}
        <style>
          {{ entry }}
        </style>
    {% endfor %}

Feels like it shouldn't live in the database, it would mean an extra query to the DB all the time. The best here is probably to make your own build in your own fork. To avoid conflict you copy/paste the folder with the theme and alter the code to import that instead of the current theme.

Otherwise, and assuming you don't want to alter the Python package, maybe a new config key EXTRA_CSS_FILES = [] (would load on top of current theme), or CUSTOM_BOOTSTRAP_THEME = 'https://mydomain.com/mytheme.css' which would prevent loading the current theme from loading and load yours?

Was this page helpful?
0 / 5 - 0 ratings