[kumo] Make Button emphasis foreground themeable - #763
Open
ftzi wants to merge 1 commit into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issue
Primary and destructive Buttons in
@cloudflare/kumo@2.12.0force a white foreground even though their emphasis backgrounds come from semantic theme colors. When a custom theme uses a light brand or danger color, Button text can lose contrast, and the theme has no semantic foreground hook for choosing a dark color.On current
main,KUMO_BUTTON_VARIANTSapplies!text-whiteto bothprimaryanddestructive. In the same component,getEmphasisStyle()derives the background, gradient, and ring from--color-kumo-brandor--color-kumo-danger, so those surfaces respond to theme values while the foreground remains fixed.For example, a theme that sets a light
--color-kumo-brandor--color-kumo-dangervalue renders a light emphasis surface while the computed foreground stays white. Ordinary text utilities and stylesheet rules lose to!text-white, so a dark foreground currently requires an!importantoverride.Solution
text-kumo-button-emphasis, backed by--text-color-kumo-button-emphasis.!text-whitewith!text-kumo-button-emphasisfor primary and destructive variants. The Button declaration keeps its existing precedence, but now reads a theme variable that consumers can override without!important.0.5.Validation
Remaining limits
AI disclosure
This change and pull request description were prepared by an AI coding agent at the contributor's direction.