Add textColor
prop to <Button />
to allow overriding of colors
#545
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.
This change is inspired by the limitations of the gestalt Button with different colored backgrounds. Previously, the white button worked well against a
darkGray
background as it matched in color.However, with user education now using the Pinterest blue and error states using the Pinterest red, this no longer scales to those backgrounds
With this change, the user of
Button
can pass an optionaltextColor
prop to override that font color and make the text color match against the background of the container parent.This matches 1:1 with what the PDS spec says user education and error states is supposed to be, but we previously never followed this guideline.
Before this change, developers would have to hack together custom buttons to get blue text but with this new prop, it will be included in gestalt and we can remove those hacks from the codebase.