You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add a background color option to the Text component's color prop.
Problem
Currently the Text component's color prop only accepts "default" and "muted" values. When rendering text on top of colored surfaces (e.g., primary buttons, accent backgrounds), there is no built-in way to set the text color to the background token.
Users can work around this by using className="text-background", but this bypasses the component's typed color prop and relies on Tailwind utility classes directly.
Suggested Solution
Add "inverse" to the TextColor type so that the following usage is possible:
<Textcolor="inverse">Text on colored surface</Text>
This would map to text-background under the hood, making the API more consistent and discoverable.
Why inverse?
The --color-background token already exists in the theme system.
It is commonly used in scenarios like buttons, cards, and overlays where text sits on a non-default surface.
It mirrors the pattern used by other component libraries where semantic color tokens are exposed as component props.
Additional context
This is a small but ergonomic improvement that makes the Text component more self-documenting and reduces the need for ad-hoc className usage.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Feature Request
Add a
backgroundcolor option to theTextcomponent'scolorprop.Problem
Currently the
Textcomponent'scolorprop only accepts"default"and"muted"values. When rendering text on top of colored surfaces (e.g., primary buttons, accent backgrounds), there is no built-in way to set the text color to thebackgroundtoken.Users can work around this by using
className="text-background", but this bypasses the component's typedcolorprop and relies on Tailwind utility classes directly.Suggested Solution
Add
"inverse"to theTextColortype so that the following usage is possible:This would map to
text-backgroundunder the hood, making the API more consistent and discoverable.Why
inverse?--color-backgroundtoken already exists in the theme system.Additional context
This is a small but ergonomic improvement that makes the Text component more self-documenting and reduces the need for ad-hoc className usage.
Beta Was this translation helpful? Give feedback.
All reactions