-
Notifications
You must be signed in to change notification settings - Fork 26
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
style(flat-button): implement inverted tone #869
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR, but instead of introducing a new prop, I would rather use theming for this case. I'll push a commit to show you what I mean
case 'secondary': | ||
return vars.colorSolid; | ||
return overwrittenVars.colorSolid; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if it's a dark background, it makes more sense to wrap that background in a ThemeProvider, overriding the colorSolid.
This way, if you included other UI-Kit elements that support theming, like text for example, you could do something like this. <ThemeProvider theme={{colorSurface: 'black', colorSolid: 'white'}}>
<FlatButton theme='secondary' label="Click me" />
<Text.Body>Hello world</Text.Body>
</ThemeProvider> |
I guess we could also add "inverted" prop, with duplicated functionality, but I would like to remove the inverted prop from the other components in the next breaking change release, so I don't really see the point 🤷♂ |
Summary
Add
inverted
tone toFlatButton
component.Description
This is needed when placing
FlatButton
on a dark background which makes the content not visible enough.