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

There is no surface color in the palette of createMuiTheme #21126

Closed
Ashkanph opened this issue May 20, 2020 · 5 comments
Closed

There is no surface color in the palette of createMuiTheme #21126

Ashkanph opened this issue May 20, 2020 · 5 comments
Labels
design: material This is about Material Design, please involve a visual or UX designer in the process duplicate This issue or pull request already exists

Comments

@Ashkanph
Copy link

How can I define surface color in the palette of createMuiTheme theme? It looks that your theme doesn't have surface and on surface colors.

@Ashkanph Ashkanph added design: material This is about Material Design, please involve a visual or UX designer in the process status: waiting for maintainer These issues haven't been looked at yet by a maintainer labels May 20, 2020
@Ashkanph Ashkanph changed the title Surface color There is no surface color in the palette of createMuiTheme May 20, 2020
@oliviertassinari
Copy link
Member

The equivalent is .contastText.

@oliviertassinari
Copy link
Member

Duplicate of #17241

@oliviertassinari oliviertassinari marked this as a duplicate of #17241 May 20, 2020
@oliviertassinari oliviertassinari added duplicate This issue or pull request already exists and removed status: waiting for maintainer These issues haven't been looked at yet by a maintainer labels May 20, 2020
@Ashkanph
Copy link
Author

Hi @oliviertassinari , thank you for responding fast,

But the surface color is very different from the contrastText (It is a background color, and is not related to texts at all).

Please see the below image which is from the Material document. As you see, the surface color is labeled by the number 2.

material ui dark theme

@oliviertassinari
Copy link
Member

Ah right, then you seek #18309. The closest we have is theme.palette.background.paper (Surface) and theme.palette.background.default (Background).

oliviertassinari referenced this issue May 30, 2020
- Apply #21120 to the other labels.
- Remove the Material Design label. I believe users shouldn't be able
to set any specific label on the issues. It should up to the core team to evaluate what's
a bug, a new feature, a question, a support, etc.
@borasemiz
Copy link

@oliviertassinari I don't think this issue is same as #18309. @Ashkanph's question is about how to define colors like surface and onSurface, as described by the material design spec here: Surface, Background and Error Colors.

I wish that the documentation for customizing the palette would explain how to set these colors. Indeed, I can also see references to theme.palette.background..., however, if these would be documented thoroughly here, that would be great.

According to my observation, these aren't put into the documentation for a reason. However, the Material Design spec clearly defines what these colors are and how they are used. Why not put it in the documentation?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
design: material This is about Material Design, please involve a visual or UX designer in the process duplicate This issue or pull request already exists
Projects
None yet
Development

No branches or pull requests

3 participants