GitHub user dosubot[bot] added a comment to the discussion: How to set custom 
label colors for conditional formatting?

<!-- Answer -->
The conditional formatting colors ("success", "alert", "error") are controlled 
by **theme tokens**, not `shared_label_colors`. To customize them globally, add 
this to your `superset_config.py`:

```python
THEME_DEFAULT = {
    "token": {
        "colorSuccessBg": "#52c41a",   # Your custom green
        "colorWarningBg": "#faad14",   # Your custom yellow/orange  
        "colorErrorBg": "#ff4d4f",     # Your custom red
    }
}
```

These three tokens map directly to the [preset color options in conditional 
formatting](https://github.com/apache/superset/blob/829e4d92d91ceae4b43b1ed3b063ffe45377799c/superset-frontend/src/explore/components/controls/ConditionalFormattingControl/FormattingPopoverContent.tsx#L53-L57).

**Note:** `shared_label_colors` is [unrelated to conditional 
formatting](https://github.com/apache/superset/issues/38514) — it's for 
coordinating categorical label colors across charts in a dashboard.

**Known limitation:** Changing these theme tokens [affects all UI elements 
using those semantic 
colors](https://github.com/apache/superset/discussions/35056#discussioncomment-14341740),
 not just conditional formatting. Also, [browser localStorage can cache theme 
overrides](https://github.com/apache/superset/issues/36875), so you may need to 
clear cache after changes.


<!-- Dosu Comment Footer -->
*To reply, just mention 
[@dosu](https://go.dosu.dev/dosubot?utm_source=github&utm_medium=bot-comment&utm_campaign=github-assistant&utm_content=brand-link).*

---
<sup>How did I do? 
[Good](https://app.dosu.dev/response-feedback/d0864db8-14c7-440a-95fd-1894a981d45f?feedback_type=great_response&utm_source=github&utm_medium=bot-comment&utm_campaign=github-assistant&utm_content=feedback-great_response)
 | 
[Irrelevant](https://app.dosu.dev/response-feedback/d0864db8-14c7-440a-95fd-1894a981d45f?feedback_type=irrelevant_answer&utm_source=github&utm_medium=bot-comment&utm_campaign=github-assistant&utm_content=feedback-irrelevant_answer)
 | 
[Incorrect](https://app.dosu.dev/response-feedback/d0864db8-14c7-440a-95fd-1894a981d45f?feedback_type=incorrect_sources&utm_source=github&utm_medium=bot-comment&utm_campaign=github-assistant&utm_content=feedback-incorrect_sources)
 | 
[Verbose](https://app.dosu.dev/response-feedback/d0864db8-14c7-440a-95fd-1894a981d45f?feedback_type=too_verbose&utm_source=github&utm_medium=bot-comment&utm_campaign=github-assistant&utm_content=feedback-too_verbose)
 | [Hallucination](https://app.dosu.dev/response-feedback/d0864db8-14c7-44
 
0a-95fd-1894a981d45f?feedback_type=hallucination&utm_source=github&utm_medium=bot-comment&utm_campaign=github-assistant&utm_content=feedback-hallucination)
 | [Report 
🐛](https://app.dosu.dev/response-feedback/d0864db8-14c7-440a-95fd-1894a981d45f?feedback_type=bug_report&utm_source=github&utm_medium=bot-comment&utm_campaign=github-assistant&utm_content=feedback-bug_report)
 | 
[Other](https://app.dosu.dev/response-feedback/d0864db8-14c7-440a-95fd-1894a981d45f?feedback_type=other&utm_source=github&utm_medium=bot-comment&utm_campaign=github-assistant&utm_content=feedback-other)</sup>

[![Chat with 
Dosu](https://dosu.dev/dosu-chat-badge.svg)](https://app.dosu.dev/a28d3c7e-a9d3-459e-9fb6-3a6f9ff4f357/ask?utm_source=github&utm_medium=bot-comment&utm_campaign=github-assistant&utm_content=chat-badge)&nbsp;[![Open
 in 
Cursor](https://dosu.dev/dosu-in-cursor.svg)](https://cursor.com/link/prompt?text=The%20conditional%20formatting%20colors%20%28%22success%22%2C%20%22alert%22%2C%20%22error%22%29%20are%20controlled%20by%20%2A%2Atheme%20tokens%2A%2A%2C%20not%20%60shared_label_colors%60.%20To%20customize%20them%20globally%2C%20add%20this%20to%20your%20%60superset_config.py%60%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%20%20%20%23%20Your%20custom%20green%0A%20%20%20%20%20%20%20%20%22colorWarningBg%22%3A%20%22%23faad14%22%2C%20%20%20%23%20Your%20custom%20yellow/orange%20%20%0A%20%20%20%20%20%20%20%20%22colorErrorBg%22%3A%20%22%23ff4d4f%22%2C%20%20%20%20%20%23%20Your
 
%20custom%20red%0A%20%20%20%20%7D%0A%7D%0A%60%60%60%0A%0AThese%20three%20tokens%20map%20directly%20to%20the%20%5Bpreset%20color%20options%20in%20conditional%20formatting%5D%28https%3A//github.com/apache/superset/blob/829e4d92d91ceae4b43b1ed3b063ffe45377799c/superset-frontend/src/explore/components/controls/ConditionalFormattingControl/FormattingPopoverContent.tsx%23L53-L57%29.%0A%0A%2A%2ANote%3A%2A%2A%20%60shared_label_colors%60%20is%20%5Bunrelated%20to%20conditional%20formatting%5D%28https%3A//github.com/apache/superset/issues/38514%29%20%E2%80%94%20it%27s%20for%20coordinating%20categorical%20label%20colors%20across%20charts%20in%20a%20dashboard.%0A%0A%2A%2AKnown%20limitation%3A%2A%2A%20Changing%20these%20theme%20tokens%20%5Baffects%20all%20UI%20elements%20using%20those%20semantic%20colors%5D%28https%3A//github.com/apache/superset/discussions/35056%23discussioncomment-14341740%29%2C%20not%20just%20conditional%20formatting.%20Also%2C%20%5Bbrowser%20localStorage%20can%20cache%20theme
 
%20overrides%5D%28https%3A//github.com/apache/superset/issues/36875%29%2C%20so%20you%20may%20need%20to%20clear%20cache%20after%20changes.)&nbsp;[![Join
 
Discord](https://img.shields.io/badge/join-5865F2?logo=discord&logoColor=white&label=)](https://go.dosu.dev/discord-bot?utm_source=github&utm_medium=bot-comment&utm_campaign=github-assistant&utm_content=join-discord)&nbsp;[![Share
 on 
X](https://img.shields.io/badge/X-share-black)](https://twitter.com/intent/tweet?text=%40dosu_ai%20helped%20me%20solve%20this%20issue!&url=https%3A//github.com/apache/superset/discussions/38720)

GitHub link: 
https://github.com/apache/superset/discussions/38720#discussioncomment-16192347

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

Reply via email to