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
[material-ui][AppBar] Background color is lighter than what the theme defines #41602
Comments
It appears to be the 'backgroundImage' to blame, setting |
I see it working as expected: issue-41602.mp4 |
You're not checking the colour of the element with a colour picker, you're just reading the css value. If theres a`filter` or other element layer affecting the colour of the object on screen then the colour on screen won't match thebcss value either.
Use a desktop colour picker to check the actual colour of the object on your screen; you're not following the reproduction steps as listed in the report.
…-------- Original Message --------
On 30/03/2024 05:25, Zeeshan Tamboli wrote:
I see it working as expected:
https://github.com/mui/material-ui/assets/20900032/6a6c9a4c-3b8b-4387-ae56-fe1e84e790d2
—
Reply to this email directly, [view it on GitHub](#41602 (comment)), or [unsubscribe](https://github.com/notifications/unsubscribe-auth/ABK563F2IILP73HXFSJISIDY2ZEGFAVCNFSM6AAAAABFDAPVHKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAMRXHEZDGNRVGA).
You are receiving this because you authored the thread.Message ID: ***@***.***>
|
@ZeeshanTamboli See this screenshot, the CSS shows the correct colour, the on screen colour picker shows it is not the correct colour. |
@stampycode Apologies for not following the steps initially. This is the first time I've encountered this scenario. Isn't what's displayed in the browser's CSS correct? I'm using Windows OS, so I don't have access to a color picker tool.
I'm unsure why there's a discrepancy between the color picker and CSS due to some "filter". However, I'll mark it as a bug.
I'm curious why you used a color picker tool for this demo. Did you notice that the color defined in the theme wasn't being applied? |
@ZeeshanTamboli, no problem at all! I noticed it when I saw two components next to each other that were supposed to have the same colour but were clearly different, prompting me to look harder. If you set I understand the need for some components have colour variation for a non-flat appearance, but straying from a defined colour palette which might be corporate-mandated in many cases, without being documented, isn't helpful or obvious. |
Yes, you are right, the issue is background-image: linear-gradient(rgba(255, 255, 255, 0.09), rgba(255, 255, 255, 0.09)) [ mui.mp4](url) |
Initially I'd suggest documenting the fact in the web docs if it is actually intended behaviour. I'm not sure for what purpose or underlying "thematic" reason the linear gradient exists, or if this is a common pattern throughout MUI...
If it isn't intended behaviour then it should be removed, but perhaps only when a background colour is defined?
|
Steps to reproduce
Link to live example: https://mui.com/material-ui/react-app-bar/#enable-color-on-dark
Steps:
sx={{background:'#000'}}
instead, the AppBar is now "#000" as expected.I'm using the 'Digital Colour Meter' in MacOS to analyse these colours, using 'sRGB' mode.
Current behavior
The AppBar currently sets a background colour which is lighter than the selected theme colour.
There's nothing in the documentation to suggest why this is happening nor what sub-palette of "primary" the AppBar is using, nor how to make the AppBar actually use the correct colour as defined in the palette.
Expected behavior
The AppBar should be the colour defined in the palette, or the documentation should specify which sub-palette (eg. primary.something) the AppBar is using.
Context
Trying to set the theme of my MUI app to use specific colours set via theme.
Your environment
Just use the online interactive documentation, the bug exists on the live mui.com site.
https://mui.com/material-ui/react-app-bar/#enable-color-on-dark
Search keywords: AppBar Theme Color
The text was updated successfully, but these errors were encountered: