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

<!-- Answer -->
You're right—per-component theming works for tokens included in Superset's 
allowedAntdTokens list, but fontWeight isn't one of them. Superset filters 
theme tokens and only applies those on the allowed list, so even though 
fontWeight works in the AntD Theme Editor, it has no effect in Superset's Theme 
JSON or CRUD UI 
[reference](https://github.com/apache/superset/blob/master/superset-frontend/packages/superset-ui-core/src/theme/types.ts)
 
[reference](https://github.com/apache/superset/blob/master/superset-frontend/packages/superset-ui-core/src/theme/Theme.tsx).
 That's why other tokens work as expected, but fontWeight does not.

As a workaround, you can use targeted CSS overrides or extend the Button 
component with Emotion/styled-components to adjust font weight. If you want 
theme-level support, it's possible to add new tokens to the allowed list 
(fontWeightStrong was recently added for markdown bold), so proposing 
fontWeight as an allowed token could be a good path forward 
[reference](https://github.com/apache/superset/pull/35821).

Full, hierarchical per-component theming is planned for the future, which 
should make this kind of customization easier 
[reference](https://github.com/apache/superset/issues/36842).


<!-- 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/accc25fc-b373-427d-9ecc-ef265ae2243d?feedback_type=great_response)
 | 
[Irrelevant](https://app.dosu.dev/response-feedback/accc25fc-b373-427d-9ecc-ef265ae2243d?feedback_type=irrelevant_answer)
 | 
[Incorrect](https://app.dosu.dev/response-feedback/accc25fc-b373-427d-9ecc-ef265ae2243d?feedback_type=incorrect_sources)
 | 
[Verbose](https://app.dosu.dev/response-feedback/accc25fc-b373-427d-9ecc-ef265ae2243d?feedback_type=too_verbose)
 | 
[Hallucination](https://app.dosu.dev/response-feedback/accc25fc-b373-427d-9ecc-ef265ae2243d?feedback_type=hallucination)
 | [Report 
🐛](https://app.dosu.dev/response-feedback/accc25fc-b373-427d-9ecc-ef265ae2243d?feedback_type=bug_report)
 | 
[Other](https://app.dosu.dev/response-feedback/accc25fc-b373-427d-9ecc-ef265ae2243d?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%20right%E2%80%94per-component%20theming%20works%20for%20tokens%20included%20in%20Superset%27s%20allowedAntdTokens%20list%2C%20but%20fontWeight%20isn%27t%20one%20of%20them.%20Superset%20filters%20theme%20tokens%20and%20only%20applies%20those%20on%20the%20allowed%20list%2C%20so%20even%20though%20fontWeight%20works%20in%20the%20AntD%20Theme%20Editor%2C%20it%20has%20no%20effect%20in%20Superset%27s%20Theme%20JSON%20or%20CRUD%20UI%C2%A0%5Breference%5D%28https%3A//github.com/apache/superset/blob/master/superset-frontend/packages/superset-ui-core/src/theme/types.ts%29%C2%A0%5Breference%5D%28https%3A//github.com/apache/superset/blob/master/superset-frontend/packages/superset-ui-core/src/theme/Theme.tsx%29.%20That%27s%20why%20other%20tokens%20work%20as
 
%20expected%2C%20but%20fontWeight%20does%20not.%0A%0AAs%20a%20workaround%2C%20you%20can%20use%20targeted%20CSS%20overrides%20or%20extend%20the%20Button%20component%20with%20Emotion/styled-components%20to%20adjust%20font%20weight.%20If%20you%20want%20theme-level%20support%2C%20it%27s%20possible%20to%20add%20new%20tokens%20to%20the%20allowed%20list%20%28fontWeightStrong%20was%20recently%20added%20for%20markdown%20bold%29%2C%20so%20proposing%20fontWeight%20as%20an%20allowed%20token%20could%20be%20a%20good%20path%20forward%C2%A0%5Breference%5D%28https%3A//github.com/apache/superset/pull/35821%29.%0A%0AFull%2C%20hierarchical%20per-component%20theming%20is%20planned%20for%20the%20future%2C%20which%20should%20make%20this%20kind%20of%20customization%20easier%C2%A0%5Breference%5D%28https%3A//github.com/apache/superset/issues/36842%29.)&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](http
 
s://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-15575566

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