-
-
Notifications
You must be signed in to change notification settings - Fork 32.3k
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
[AppBar] background-color and color styles not aligned between dark and light colorSchemes #43800
Comments
@croraf I think I solved it. It looks like this issue is caused by differences in If you use Checkout the code sandbox here to see the issue. When in light mode, the app bar still has the grey background present in dark mode. However, if you switch from @siriwatknp @zannager what is the correct behavior here? Should |
@jonesmac please use I see that from your code, the styles is using createTheme({
cssVariables: {
+ colorSchemeSelector: 'class',
}
}) |
@croraf Please provide a reproducible sandbox that we can take a look. |
@siriwatknp updated |
@siriwatknp I've seen that note in the docs, however, it appears adding the |
@croraf Have you checked this? https://mui.com/material-ui/react-app-bar/#enable-color-on-dark |
Since the issue is missing key information and has been inactive for 7 days, it has been automatically closed. If you wish to see the issue reopened, please provide the missing information. |
Steps to reproduce
Link to live example: https://codesandbox.io/p/sandbox/dark-theme-appbar-bug-forked-h6ymlh
Steps:
Notice the styles on the AppBar in light mode
switch to dark mode using the button
Notice the styles on the AppBar in dark mode
Current behavior
In light scheme the
background-color
is set tovar(--AppBar-background)
while in dark scheme it is taken fromdark.palette.background.paper
(you can test this by changing this property in the theme inindex.tsx
).Also in light scheme the
color
is set tovar(--AppBar-color)
while in dark scheme it is taken fromdark.palette.text.primary
(you can test this by changing this property in the theme inindex.tsx
)Expected behavior
It is expected that both schemes behave the same.
Context
No response
Your environment
npx @mui/envinfo
System:
OS: Linux 6.5 Ubuntu 22.04.4 LTS 22.04.4 LTS (Jammy Jellyfish)
Binaries:
Node: 18.12.1 - ~/.nvm/versions/node/v18.12.1/bin/node
npm: 8.19.2 - ~/.nvm/versions/node/v18.12.1/bin/npm
pnpm: Not Found
Browsers:
Chrome: 129.0.6668.58
npmPackages:
@emotion/react: ^11.13.3 => 11.13.3
@emotion/styled: ^11.13.0 => 11.13.0
@mui/base: 5.0.0-beta.58
@mui/core-downloads-tracker: 6.0.2
@mui/icons-material: ^6.0.2 => 6.0.2
@mui/lab: ^6.0.0-beta.9 => 6.0.0-beta.9
@mui/material: ^6.0.2 => 6.0.2
@mui/private-theming: 6.0.2
@mui/styled-engine: 6.0.2
@mui/styles: ^6.0.2 => 6.0.2
@mui/system: ^6.0.2 => 6.0.2
@mui/types: 7.2.16
@mui/utils: 5.16.6
@mui/x-charts: ^7.16.0 => 7.16.0
@mui/x-charts-vendor: 7.16.0
@mui/x-date-pickers: ^7.18.0 => 7.18.0
@mui/x-internals: 7.16.0
@mui/x-tree-view: ^7.16.0 => 7.16.0
@types/react: ^18.3.5 => 18.3.5
react: ^18.3.1 => 18.3.1
react-dom: ^18.3.1 => 18.3.1
typescript: ^5.5.4 => 5.5.4
Search keywords: AppBar background dark light colorScheme
The text was updated successfully, but these errors were encountered: