question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Allow to overwrite contrast color in palette

See original GitHub issue

I want to be able to also overwrite the contrast color for a color palette. Like I can define the primary and the accent color, I also want to be able to set the contrast color.

For example: I have a green navbar with some icons on it. And because my color palette is dynamic (multiple predefined colors), I want to use contrast. But when I use contrast, the icons are black: screenshot_2018 01 16_14h38m36s_001_

So just like primary, I want to be able to set my own contrast color.

const theme = createMuiTheme({
  palette: {
    primary: green,
    secondary: orange,
    contrast: white,
  },
});

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:6 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
ValentinHcommented, Jan 16, 2018

The contrastText is only used for contrast buttons. This is a bit misleading as I would expect the following example to display a button with white text: https://codesandbox.io/s/9l0109n94p

I guess this is what @TheZoker was asking initially.

0reactions
ValentinHcommented, Jan 16, 2018

Done: #9913

Read more comments on GitHub >

github_iconTop Results From Across the Web

Allow to overwrite contrast color in palette · Issue #9908 - GitHub
I have a green navbar with some icons on it. And because my color palette is dynamic (multiple predefined colors), I want to...
Read more >
Palette - Material UI - MUI
The palette enables you to modify the color of the components to suit your brand. Palette colors. The theme exposes the following palette...
Read more >
iOS Color Contrast Best Practice: Increase Contrast | Deque
The easiest way to support Increase Contrast is to simply use the default color scheme. All controls and text become darker when Increase ......
Read more >
Styling for Windows high contrast with new standards for ...
We're styling the following widget, which gives the user some suggested color palettes: A widget titled, Your Style: Color. You gravitate ...
Read more >
angular material 2 custom theme button contrast
The contrast property tells Material what color to choose over the color background. So the line 100: #000000 means "when the background is...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found