GitHub user dosubot[bot] added a comment to the discussion: Button text 
fontWeight customization via theme tokens (Superset 6)

<!-- Answer -->
You're correct—customizing button text fontWeight via theme tokens isn't 
currently possible in Superset 6. The theme system filters Ant Design tokens to 
a specific allowed list (see `allowedAntdTokens` in `types.ts`), and 
`fontWeight` isn't included, so it can't be set through the Theme CRUD UI or 
theme config—even though it works in the AntD theme editor. This isn't 
explicitly documented as intentional, but it's a limitation of how Superset 6 
exposes only a subset of Ant Design's theming options for now 
[reference](https://github.com/apache/superset/blob/master/superset-frontend/packages/superset-ui-core/src/theme/types.ts).

Theming in Superset 6 currently only supports global tokens and doesn't allow 
per-component overrides (like for buttons), which is why you can't target 
button fontWeight directly 
[reference](https://github.com/apache/superset/issues/36842). The recommended 
workaround is to use targeted CSS overrides (for example, via a custom CSS file 
or by extending components with Emotion/styled-components) if you need to 
adjust button font weight for accessibility or visual reasons.

There are plans to improve this: once the Ant Design v5 migration is fully 
integrated, Superset aims to support hierarchical, per-component theming, which 
should make this kind of customization possible through theme tokens in the 
future [reference](https://github.com/apache/superset/issues/36842).

If you want to see `fontWeight` supported as a theme token for buttons, it 
would make sense to propose adding it to the allowedAntdTokens list, especially 
since it improves accessibility and readability in dark themes. For now, CSS 
overrides are your best bet.


<!-- 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/5912e910-7bc0-4ff5-872b-809a5e299f69?feedback_type=great_response)
 | 
[Irrelevant](https://app.dosu.dev/response-feedback/5912e910-7bc0-4ff5-872b-809a5e299f69?feedback_type=irrelevant_answer)
 | 
[Incorrect](https://app.dosu.dev/response-feedback/5912e910-7bc0-4ff5-872b-809a5e299f69?feedback_type=incorrect_sources)
 | 
[Verbose](https://app.dosu.dev/response-feedback/5912e910-7bc0-4ff5-872b-809a5e299f69?feedback_type=too_verbose)
 | 
[Hallucination](https://app.dosu.dev/response-feedback/5912e910-7bc0-4ff5-872b-809a5e299f69?feedback_type=hallucination)
 | [Report 
🐛](https://app.dosu.dev/response-feedback/5912e910-7bc0-4ff5-872b-809a5e299f69?feedback_type=bug_report)
 | 
[Other](https://app.dosu.dev/response-feedback/5912e910-7bc0-4ff5-872b-809a5e299f69?feedback_type=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)&nbsp;[![Open
 in 
Cursor](https://dosu.dev/dosu-in-cursor.svg)](https://cursor.com/link/prompt?text=You%27re%20correct%E2%80%94customizing%20button%20text%20fontWeight%20via%20theme%20tokens%20isn%27t%20currently%20possible%20in%20Superset%206.%20The%20theme%20system%20filters%20Ant%20Design%20tokens%20to%20a%20specific%20allowed%20list%20%28see%20%60allowedAntdTokens%60%20in%20%60types.ts%60%29%2C%20and%20%60fontWeight%60%20isn%27t%20included%2C%20so%20it%20can%27t%20be%20set%20through%20the%20Theme%20CRUD%20UI%20or%20theme%20config%E2%80%94even%20though%20it%20works%20in%20the%20AntD%20theme%20editor.%20This%20isn%27t%20explicitly%20documented%20as%20intentional%2C%20but%20it%27s%20a%20limitation%20of%20how%20Superset%206%20exposes%20only%20a%20subset%20of%20Ant%20Design%27s%20theming%20options%20for%20now%C2%A0%5Breference%5D%28https%3A//github.c
 
om/apache/superset/blob/master/superset-frontend/packages/superset-ui-core/src/theme/types.ts%29.%0A%0ATheming%20in%20Superset%206%20currently%20only%20supports%20global%20tokens%20and%20doesn%27t%20allow%20per-component%20overrides%20%28like%20for%20buttons%29%2C%20which%20is%20why%20you%20can%27t%20target%20button%20fontWeight%20directly%C2%A0%5Breference%5D%28https%3A//github.com/apache/superset/issues/36842%29.%20The%20recommended%20workaround%20is%20to%20use%20targeted%20CSS%20overrides%20%28for%20example%2C%20via%20a%20custom%20CSS%20file%20or%20by%20extending%20components%20with%20Emotion/styled-components%29%20if%20you%20need%20to%20adjust%20button%20font%20weight%20for%20accessibility%20or%20visual%20reasons.%0A%0AThere%20are%20plans%20to%20improve%20this%3A%20once%20the%20Ant%20Design%20v5%20migration%20is%20fully%20integrated%2C%20Superset%20aims%20to%20support%20hierarchical%2C%20per-component%20theming%2C%20which%20should%20make%20this%20kind%20of%20customization%20poss
 
ible%20through%20theme%20tokens%20in%20the%20future%C2%A0%5Breference%5D%28https%3A//github.com/apache/superset/issues/36842%29.%0A%0AIf%20you%20want%20to%20see%20%60fontWeight%60%20supported%20as%20a%20theme%20token%20for%20buttons%2C%20it%20would%20make%20sense%20to%20propose%20adding%20it%20to%20the%20allowedAntdTokens%20list%2C%20especially%20since%20it%20improves%20accessibility%20and%20readability%20in%20dark%20themes.%20For%20now%2C%20CSS%20overrides%20are%20your%20best%20bet.)&nbsp;[![Join
 
Discord](https://img.shields.io/badge/join-5865F2?logo=discord&logoColor=white&label=)](https://go.dosu.dev/discord-bot)&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/37373)

GitHub link: 
https://github.com/apache/superset/discussions/37373#discussioncomment-15575543

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