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

[Chip] Bad color contrast when using the dark theme #9407

Closed
1 task done
MaximKudriavtsev opened this issue Dec 6, 2017 · 10 comments
Closed
1 task done

[Chip] Bad color contrast when using the dark theme #9407

MaximKudriavtsev opened this issue Dec 6, 2017 · 10 comments
Labels
component: chip This is the name of the generic UI component, not the React module! good first issue Great for first contributions. Enable to learn the contribution process.
Milestone

Comments

@MaximKudriavtsev
Copy link
Contributor

MaximKudriavtsev commented Dec 6, 2017

  • I have searched the issues of this repository and believe that this is not a duplicate.

Expected Behavior

I want more color contrast when using the dark theme

Current Behavior

Bad color contrast when using the Chip component with the dark theme

Steps to Reproduce (for bugs)

You may see this on example
You may see how different color contrasts are in light and dark themes

Context

I want that visualization of my dark application is good

Your Environment

Tech Version
Material-UI 1.0.0-beta.21
React 16.1.1
browser Chrome 62.0.3202.94
os Windows 10
@oliviertassinari oliviertassinari added component: chip This is the name of the generic UI component, not the React module! good first issue Great for first contributions. Enable to learn the contribution process. labels Dec 6, 2017
@oliviertassinari
Copy link
Member

oliviertassinari commented Dec 6, 2017

Changing the approach to a background color using theme.palette.background.chip seems to be more appropriate.

  • light: chip: grey[300],
  • dark: chip: grey[700],

@pajaydev
Copy link
Contributor

pajaydev commented Dec 7, 2017

@oliviertassinari Can I create the pull request?.

@mbrookes
Copy link
Member

mbrookes commented Dec 7, 2017

Because the chip bacground is a mid-grey, it might be possible to simplify things considerably by having Chip not change color for the dark theme. The spec doesn't show a dark variant.

@oliviertassinari oliviertassinari added this to the Future milestone Dec 7, 2017
@vladimirpekez
Copy link

Just to add my 2 cents - grayish clickable/deletable hover/focus/active styles should be easier to customize/override. For example if you have chips in various colors and want to remove grayish clickable/deletable hover/focus/active styles while retaining base chip color the same how would you do it?

@oliviertassinari
Copy link
Member

@vladimirpekez It can easily be done with the override API. Feel free to open a question on StackOverflow if needed.

@vladimirpekez
Copy link

@oliviertassinari Done: https://stackoverflow.com/questions/47817109/how-to-eliminate-hover-active-focus-gray-color-in-material-ui-chip-component.

Colleague at our team who needed to eliminate grey hover/active style ended up with several chips components, each created to override certain color - there has to be a better way ;)

@mbrookes
Copy link
Member

it might be possible to simplify things considerably by having Chip not change color for the dark theme.

This wasn't practical, as our implementation of Avatar has a dark theme. Changing Chip to a mono-theme would have meant changing both.

Much as we want to avoid component specific colors in the theme, I've gone with @oliviertassinari's solution in #9501. That at least makes it easier to have a custom chip color while having hover & focus colors match.

I had to use dark: chip: grey[800], however, for sufficient contrast with the dark Avatar background.

@kgregory
Copy link
Member

Colleague at our team who needed to eliminate grey hover/active style ended up with several chips components, each created to override certain color - there has to be a better way ;)

@vladimirpekez Seems like a good opportunity for the factory pattern. We can continue this discussion on StackOverflow.

@MaximKudriavtsev
Copy link
Contributor Author

This issue is actual.
My example demonstrated this.

@oliviertassinari
Copy link
Member

oliviertassinari commented Jan 9, 2018

It seems we have reached a dead end #9501 (comment).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: chip This is the name of the generic UI component, not the React module! good first issue Great for first contributions. Enable to learn the contribution process.
Projects
None yet
Development

No branches or pull requests

6 participants