You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by "parag2131 (via GitHub)" <gi...@apache.org> on 2025/12/31 05:22:54 UTC
[I] Conditional Formatting colors do not respect UI Theme tokens (colorSuccess, colorWarning, colorError) [superset]
parag2131 opened a new issue, #36875:
URL: https://github.com/apache/superset/issues/36875
### Bug description
Conditional formatting in Big Number (and similar charts) does not respect UI Theme tokens defined via THEME_DEFAULT or Theme Administration.
Even when colorSuccess, colorWarning, and colorError are explicitly defined in the UI theme configuration, selecting success / warning / error in conditional formatting continues to use Superset’s hardcoded default colors instead of the themed values.
This creates an inconsistency where:
UI elements follow the active theme correctly
Conditional formatting colors remain unchanged and cannot be themed globally
🔹 Environment
Superset version: 6.0.0
Deployment: Docker
Feature flag enabled:
ENABLE_UI_THEME_ADMINISTRATION = True
Theme configuration example:
THEME_DEFAULT = {
"token": {
"colorPrimary": "#2893B3",
"colorSuccess": "#5ac189",
"colorWarning": "#f4d35e",
}
}
🔹 Steps to reproduce
Enable UI Theme Administration
Define colorSuccess, colorWarning, colorError in THEME_DEFAULT
Restart Superset and verify the theme appears under Settings → Themes
Create a Big Number chart
Add conditional formatting and select success as the color scheme
Observe the rendered color
🔹 Expected behavior
Conditional formatting using:
success
warning
error
should use the corresponding theme tokens:
colorSuccess
colorWarning
colorError
so that dashboard visuals are fully aligned with the active UI theme.
🔹 Actual behavior
Conditional formatting colors:
Ignore UI theme tokens
Continue using Superset’s default hardcoded colors
Cannot be customized globally via themes
🔹 Additional context
UI theming works correctly for buttons, inputs, and layout elements
This appears to be a gap between the Ant Design theme system and legacy / visualization-level conditional formatting
Related discussions indicate theming coverage is still partial (e.g. SIP-82)
This enhancement would significantly improve brand consistency for themed Superset deployments.
### Screenshots/recordings
_No response_
### Superset version
master / latest-dev 6.0.0
### Python version
3.9
### Node version
16
### Browser
Chrome
### Additional context
_No response_
### Checklist
- [ ] I have searched Superset docs and Slack and didn't find a solution to my problem.
- [ ] I have searched the GitHub issue tracker and didn't find a similar bug report.
- [ ] I have checked Superset's logs for errors and if I found a relevant Python stacktrace, I included it here as text in the "additional context" section.
--
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: notifications-unsubscribe@superset.apache.org.apache.org
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
Re: [I] Conditional Formatting colors do not respect UI Theme tokens (colorSuccess, colorWarning, colorError) [superset]
Posted by "parag2131 (via GitHub)" <gi...@apache.org>.
parag2131 closed issue #36875: Conditional Formatting colors do not respect UI Theme tokens (colorSuccess, colorWarning, colorError)
URL: https://github.com/apache/superset/issues/36875
--
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: notifications-unsubscribe@superset.apache.org
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
Re: [I] Conditional Formatting colors do not respect UI Theme tokens (colorSuccess, colorWarning, colorError) [superset]
Posted by "dosubot[bot] (via GitHub)" <gi...@apache.org>.
dosubot[bot] commented on issue #36875:
URL: https://github.com/apache/superset/issues/36875#issuecomment-3701467301
<!-- Greeting -->
Hi @parag2131! I'm [Dosu](https://go.dosu.dev/dosubot) and I’m helping the superset team.
<!-- Answer -->
This is a confirmed gap in Superset: conditional formatting in Big Number and similar charts does not use the UI theme tokens colorSuccess, colorWarning, or colorError. Instead, it uses preset colors that are not linked to your theme settings, so updating THEME_DEFAULT with those tokens has no effect on conditional formatting colors in charts.
Currently, the only way to globally change the conditional formatting colors for "success", "warning", and "error" in these charts is to override the tokens colorSuccessBg, colorWarningBg, and colorErrorBg in your THEME_DEFAULT config. For example:
```python
THEME_DEFAULT = {
"token": {
"colorSuccessBg": "#52c41a",
"colorWarningBg": "#faad14",
"colorErrorBg": "#ff4d4f",
}
}
```
This will update the preset colors used in the conditional formatting dialog, but it also affects all other places in Superset that use these background tokens. There is no way to set these colors just for Big Number or to use the text tokens (colorSuccess, colorWarning, colorError) without a code change. The UI does not allow picking custom colors or entering hex codes for conditional formatting—only the three preset theme colors are available, and those are controlled by the Bg tokens, not the text tokens you expected. [See discussion and code references](https://github.com/apache/superset/discussions/35056).
The technical reason is that the chart's conditional formatting logic (via colorThresholdFormatters) does not reference the theme tokens for text colors, only the preset palette or Bg tokens. To make conditional formatting respect colorSuccess, colorWarning, and colorError, the formatter logic would need to be updated to pull those values from the live theme context when applying success/warning/error formats. This would require changes in the Big Number chart plugin and the formatter construction logic [see code](https://github.com/apache/superset/blob/829e4d92d91ceae4b43b1ed3b063ffe45377799c/superset-frontend/plugins/plugin-chart-echarts/src/BigNumber/BigNumberViz.tsx#L208-L586).
There is also a known limitation: if you use the Theme Editor or switch themes in the UI, Superset will use the theme stored in your browser's localStorage, which overrides the backend THEME_DEFAULT config until you clear localStorage. This can make theme changes appear inconsistent if you are testing different approaches [see explanation](https://github.com/apache/superset/issues/33930).
If you want to contribute a fix or need pointers to the relevant files for updating the formatter logic to use the text tokens, let me know!
<!-- Dosu Comment Footer -->
*To reply, just mention [@dosu](https://go.dosu.dev/dosubot).*
---
<sup>How did I do? [Good](https://app.dosu.dev/response-feedback/2b37c8ad-0a57-4df3-9d53-f8a6fd9bbee3?feedback_type=great_response) | [Irrelevant](https://app.dosu.dev/response-feedback/2b37c8ad-0a57-4df3-9d53-f8a6fd9bbee3?feedback_type=irrelevant_answer) | [Incorrect](https://app.dosu.dev/response-feedback/2b37c8ad-0a57-4df3-9d53-f8a6fd9bbee3?feedback_type=incorrect_sources) | [Verbose](https://app.dosu.dev/response-feedback/2b37c8ad-0a57-4df3-9d53-f8a6fd9bbee3?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/2b37c8ad-0a57-4df3-9d53-f8a6fd9bbee3?feedback_type=hallucination) | [Report 🐛](https://app.dosu.dev/response-feedback/2b37c8ad-0a57-4df3-9d53-f8a6fd9bbee3?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/2b37c8ad-0a57-4df3-9d53-f8a6fd9bbee3?feedback_type=other)</sup>
[](https://app.dosu.dev/a28d3c7e-a9d3-459e-9fb6-3a6f9ff4f357/ask?utm_source=github) [](https://cursor.com/link/prompt?text=This%20is%20a%20confirmed%20gap%20in%20Superset%3A%20conditional%20formatting%20in%20Big%20Number%20and%20similar%20charts%20does%20not%20use%20the%20UI%20theme%20tokens%20colorSuccess%2C%20colorWarning%2C%20or%20colorError.%20Instead%2C%20it%20uses%20preset%20colors%20that%20are%20not%20linked%20to%20your%20theme%20settings%2C%20so%20updating%20THEME_DEFAULT%20with%20those%20tokens%20has%20no%20effect%20on%20conditional%20formatting%20colors%20in%20charts.%0A%0ACurrently%2C%20the%20only%20way%20to%20globally%20change%20the%20conditional%20formatting%20colors%20for%20%22success%22%2C%20%22warning%22%2C%20and%20%22error%22%20in%20these%20charts%20is%20to%20override%20the%20tokens%20colorSuccessBg%2C%20colorWarningBg%2C%20and%20colorErrorBg%20in%20yo
ur%20THEME_DEFAULT%20config.%20For%20example%3A%0A%0A%60%60%60python%0ATHEME_DEFAULT%20%3D%20%7B%0A%20%20%20%20%22token%22%3A%20%7B%0A%20%20%20%20%20%20%20%20%22colorSuccessBg%22%3A%20%22%2352c41a%22%2C%0A%20%20%20%20%20%20%20%20%22colorWarningBg%22%3A%20%22%23faad14%22%2C%0A%20%20%20%20%20%20%20%20%22colorErrorBg%22%3A%20%22%23ff4d4f%22%2C%0A%20%20%20%20%7D%0A%7D%0A%60%60%60%0A%0AThis%20will%20update%20the%20preset%20colors%20used%20in%20the%20conditional%20formatting%20dialog%2C%20but%20it%20also%20affects%20all%20other%20places%20in%20Superset%20that%20use%20these%20background%20tokens.%20There%20is%20no%20way%20to%20set%20these%20colors%20just%20for%20Big%20Number%20or%20to%20use%20the%20text%20tokens%20%28colorSuccess%2C%20colorWarning%2C%20colorError%29%20without%20a%20code%20change.%20The%20UI%20does%20not%20allow%20picking%20custom%20colors%20or%20entering%20hex%20codes%20for%20conditional%20formatting%E2%80%94only%20the%20three%20preset%20theme%20colors%20are%20available%2C
%20and%20those%20are%20controlled%20by%20the%20Bg%20tokens%2C%20not%20the%20text%20tokens%20you%20expected.%20%5BSee%20discussion%20and%20code%20references%5D%28https%3A//github.com/apache/superset/discussions/35056%29.%0A%0AThe%20technical%20reason%20is%20that%20the%20chart%27s%20conditional%20formatting%20logic%20%28via%20colorThresholdFormatters%29%20does%20not%20reference%20the%20theme%20tokens%20for%20text%20colors%2C%20only%20the%20preset%20palette%20or%20Bg%20tokens.%20To%20make%20conditional%20formatting%20respect%20colorSuccess%2C%20colorWarning%2C%20and%20colorError%2C%20the%20formatter%20logic%20would%20need%20to%20be%20updated%20to%20pull%20those%20values%20from%20the%20live%20theme%20context%20when%20applying%20success/warning/error%20formats.%20This%20would%20require%20changes%20in%20the%20Big%20Number%20chart%20plugin%20and%20the%20formatter%20construction%20logic%20%5Bsee%20code%5D%28https%3A//github.com/apache/superset/blob/829e4d92d91ceae4b43b1ed3b063ffe45377799c/s
uperset-frontend/plugins/plugin-chart-echarts/src/BigNumber/BigNumberViz.tsx%23L208-L586%29.%0A%0AThere%20is%20also%20a%20known%20limitation%3A%20if%20you%20use%20the%20Theme%20Editor%20or%20switch%20themes%20in%20the%20UI%2C%20Superset%20will%20use%20the%20theme%20stored%20in%20your%20browser%27s%20localStorage%2C%20which%20overrides%20the%20backend%20THEME_DEFAULT%20config%20until%20you%20clear%20localStorage.%20This%20can%20make%20theme%20changes%20appear%20inconsistent%20if%20you%20are%20testing%20different%20approaches%20%5Bsee%20explanation%5D%28https%3A//github.com/apache/superset/issues/33930%29.%0A%0AIf%20you%20want%20to%20contribute%20a%20fix%20or%20need%20pointers%20to%20the%20relevant%20files%20for%20updating%20the%20formatter%20logic%20to%20use%20the%20text%20tokens%2C%20let%20me%20know%21) [](https://go.dosu.dev/discord-bot) [](https://twitter.com/intent/tweet?text=%40dosu_ai%20helped%20me%20solve%20this%20issue!&url=https%3A//github.com/apache/superset/issues/36875)
--
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: notifications-unsubscribe@superset.apache.org
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