-
-
Notifications
You must be signed in to change notification settings - Fork 32.5k
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
Changes from all commits
0afec0a
abb9f25
4bf2134
3966537
7067984
ae4c7c1
7412e55
fce41fd
bb0159f
d0d842a
acaedeb
a7e609b
103b5cb
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -136,3 +136,27 @@ function HideOnScroll(props) { | |||||||||||||||||||
); | ||||||||||||||||||||
} | ||||||||||||||||||||
``` | ||||||||||||||||||||
|
||||||||||||||||||||
## 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 commentThe reason will be displayed to describe this comment to others. Learn more. Prefer breaking lines between sentences, makes reviewing easier:
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We usually don't mention previous versions:
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @mbrookes Are you OK to settle on this terminology?
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
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 commentThe reason will be displayed to describe this comment to others. Learn more. |
||||||||||||||||||||
|
||||||||||||||||||||
```jsx | ||||||||||||||||||||
// Specific element via prop | ||||||||||||||||||||
<AppBar enableColorOnDark /> | ||||||||||||||||||||
|
||||||||||||||||||||
// Affect all AppBars via theme | ||||||||||||||||||||
<ThemeProvider | ||||||||||||||||||||
theme={createTheme({ | ||||||||||||||||||||
components: { | ||||||||||||||||||||
MuiAppBar: { | ||||||||||||||||||||
defaultProps: { | ||||||||||||||||||||
enableColorOnDark: true, | ||||||||||||||||||||
}, | ||||||||||||||||||||
}, | ||||||||||||||||||||
}, | ||||||||||||||||||||
})} | ||||||||||||||||||||
> | ||||||||||||||||||||
<AppBar /> | ||||||||||||||||||||
</ThemeProvider> | ||||||||||||||||||||
``` |
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:
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