Skip to content
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

Merged
merged 2 commits into from
Jun 18, 2019
Merged

Conversation

ahmehri
Copy link
Member

@ahmehri ahmehri commented Jun 18, 2019

Summary

Add inverted tone to FlatButton component.

Description

This is needed when placing FlatButton on a dark background which makes the content not visible enough.

@ahmehri ahmehri added the 💅 Type: Enhancement Improves existing code label Jun 18, 2019
@ahmehri ahmehri requested a review from montezume June 18, 2019 09:37
Copy link
Contributor

@montezume montezume left a 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;
Copy link
Contributor

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.

@montezume
Copy link
Contributor

This is what it looks like in the VRT app
Screen Shot 2019-06-18 at 11 52 58 AM

@montezume
Copy link
Contributor

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>

@montezume montezume requested review from jonnybel and tdeekens June 18, 2019 09:56
@montezume montezume dismissed their stale review June 18, 2019 11:04

updated pr

@montezume
Copy link
Contributor

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 🤷‍♂

@montezume montezume removed the request for review from tdeekens June 18, 2019 11:36
@montezume montezume merged commit 59e40d5 into master Jun 18, 2019
@montezume montezume deleted the am-FlatButton-inverted branch June 18, 2019 11:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
💅 Type: Enhancement Improves existing code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants