GitHub user jpgomezv added a comment to the discussion: Need an urgent help How
can i change text color and background of canvas in dark theme
Superset's UI colors (including the chart canvas) come from the theme in
`@superset-ui/core` — CSS variables like `--background-color`,
`--background-secondary-color`, `--text-color`, etc. There's no per-dashboard
color picker, but you can override the theme globally with the built-in **CSS
Templates** feature:
1. In the UI go to **Settings → CSS Templates → New CSS Template**.
2. Add overrides targeting the theme variables and the chart containers. For
example:
```css
body, .dashboard, .dashboard-grid {
background-color: #121212;
color: #e0e0e0;
}
.dashboard-component-chart-holder, .chart-container, .panel {
background-color: #1e1e1e !important;
color: #e0e0e0 !important;
}
.chart-title {
color: #e0e0e0 !important;
}
```
3. In the dashboard's **Edit → Customize**, set **"CSS"** to your template (or
apply it as the default CSS template in Settings → Dashboard Settings).
If you need it site-wide by default (not per dashboard), you can also ship the
override in `superset_config.py` via `EXTRA_CSS` (older versions) or by loading
a static stylesheet — but the CSS Template route is the supported, no-code way
and applies instantly without rebuilding the frontend.
One caveat: chart canvases rendered by the chart plugin (e.g. ECharts)
sometimes read the theme at render time from `supersetTheme`/`theme.colors`, so
a pure CSS override may not recolor series/axes inside the plot area itself —
for those, the reliable approach is to define a custom theme in
`superset_config.py` (`DEFAULT_THEME` / passing a theme into the charts) or set
the chart's own background options. For most canvas/background cases, the CSS
template above is enough.
If this answers your question, feel free to mark it as the accepted answer!
GitHub link:
https://github.com/apache/superset/discussions/42844#discussioncomment-18058598
----
This is an automatically sent email for [email protected].
To unsubscribe, please send an email to:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]