-
-
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] Fix background color on dark mode #26545
Conversation
skipColorOnDark
prop to disable color in dark modecolor
prop on dark mode
color
prop on dark modecolor
on dark mode
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A quick review. Could we also remove the custom CSS we apply for the app bar of the documentation?
color
on dark modecolor
on dark mode by default
color
on dark mode by defaultCo-authored-by: Olivier Tassinari <olivier.tassinari@gmail.com>
Co-authored-by: Olivier Tassinari <olivier.tassinari@gmail.com>
@@ -136,3 +136,27 @@ function HideOnScroll(props) { | |||
); | |||
} | |||
``` | |||
|
|||
## Enable Color on Dark |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Our heading capitalization convention:
## Enable Color on Dark | |
## Enable color on dark |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We might want to explain what "on dark" mean
## Enable Color on Dark | |
## Enable color on dark mode |
|
||
## Enable Color on Dark | ||
|
||
From v5 onward, `color` prop has no effect on dark mode according to [material design spec](https://material.io/design/color/dark-theme.html). You can opt out by passing `enableColorOnDark` prop. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Prefer breaking lines between sentences, makes reviewing easier:
From v5 onward, `color` prop has no effect on dark mode according to [material design spec](https://material.io/design/color/dark-theme.html). You can opt out by passing `enableColorOnDark` prop. | |
From v5 onward, `color` prop has no effect on dark mode according to [material design spec](https://material.io/design/color/dark-theme.html). | |
You can opt out by passing `enableColorOnDark` prop. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We usually don't mention previous versions:
From v5 onward, `color` prop has no effect on dark mode according to [material design spec](https://material.io/design/color/dark-theme.html). You can opt out by passing `enableColorOnDark` prop. | |
The `color` prop has no effect on dark mode according to [material design spec](https://material.io/design/color/dark-theme.html). | |
You can opt out by passing `enableColorOnDark` prop. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mbrookes Are you OK to settle on this terminology?
From v5 onward, `color` prop has no effect on dark mode according to [material design spec](https://material.io/design/color/dark-theme.html). You can opt out by passing `enableColorOnDark` prop. | |
The `color` prop has no effect on dark mode according to [Material Design guidelines](https://material.io/design/color/dark-theme.html). | |
You can opt out by passing `enableColorOnDark` prop. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mbrookes Are you OK to settle on this terminology?
No, but it seems that it was merged before you asked 🙂.
A gentle reminder to @mui-org/maintainers to tag me on any PRs with new or significantly changed language or terminology.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have updated the PR description to include the breaking changes. We will use it for the changelog of the next version. |
Hi @siriwatknp I started using material ui at However, it did take me like 15/20 minutes of confusion with the old color not easily coming back from setting the color prop, I thought I was going crazy. But then I did some deep digging and found this. One thing that could be helpful is if the sites documentation was updated to include the Again, seriously killer lib, and I'm unblocked/fixed this relatively easily. Best, |
@JakeRuth Use the documentation of the version you are using 😁 https://next.material-ui.com/api/app-bar/ |
I have embarrassingly using the wrong version of the libs my entire time using this lib! |
Breaking changes
The
color
prop has no longer any effect in dark mode. The app bar uses the background color required by the elevation to follow the Material Design guidelines. UseenableColorOnDark
to restore the behavior of v4.closes #18308
Preview https://deploy-preview-26545--material-ui.netlify.app/components/app-bar/
The case of AppBar is special because the specified color should be enabled only in
light
mode. I propose the fix by adding another flag (naming can be discussed) to neglect the color prop in dark mode. This approach works great becauseAppBar
inheritPaper
which support elevation already. The flag istrue
by default (consider breaking change) due to the material design specEven bottom appbar also use elevation https://material.io/design/color/dark-theme.html#custom-application
Default Behavior
Enable for specific component (opt out via prop)
Enable globally (opt out via theme)