-
-
Notifications
You must be signed in to change notification settings - Fork 32.6k
[docs][material-ui] Improve theme.applyStyles()
docs
#44658
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
Merged
Merged
Changes from 7 commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
c68a51b
Improve applyStyles docs
DiegoAndai 214cf5c
Fix examples
DiegoAndai 6f91125
Link consistency
DiegoAndai 557a511
Revert unrelated format change
DiegoAndai 74afca7
Apply review suggestions
DiegoAndai 55fc452
Reword warning phrasing
DiegoAndai be9b07b
Link to styling in drak mode section instead of applyStyles API
DiegoAndai 464ffb4
Use sx prop applystyles array syntax in docs
DiegoAndai 46ac404
Merge branch 'master' into improve-applystyles-docs
DiegoAndai 649d41d
Use applyStyles array syntax everywhere on docs
DiegoAndai 26e8ef7
Update docs/data/material/customization/dark-mode/dark-mode.md
DiegoAndai 13d8ba0
Fix examples
DiegoAndai File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,10 +13,14 @@ export interface ApplyStyles<K extends string> { | |
* | ||
* Tips: Use an array over object spread and place `theme.applyStyles()` last. | ||
* | ||
* With the styled function: | ||
* ✅ [{ background: '#e5e5e5' }, theme.applyStyles('dark', { background: '#1c1c1c' })] | ||
* | ||
* 🚫 { background: '#e5e5e5', ...theme.applyStyles('dark', { background: '#1c1c1c' })} | ||
* | ||
* With the sx prop: | ||
* ✅ [{ background: '#e5e5e5' }, theme => theme.applyStyles('dark', { background: '#1c1c1c' })] | ||
* 🚫 { background: '#e5e5e5', ...theme => theme.applyStyles('dark', { background: '#1c1c1c' })} | ||
* | ||
* @example | ||
* 1. using with `styled`: | ||
* ```jsx | ||
|
@@ -32,9 +36,9 @@ export interface ApplyStyles<K extends string> { | |
* @example | ||
* 2. using with `sx` prop: | ||
* ```jsx | ||
* <Box sx={theme => [ | ||
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. This doesn't work, sx prop doesn't accept |
||
* <Box sx={[ | ||
* { background: '#e5e5e5' }, | ||
* theme.applyStyles('dark', { | ||
* theme => theme.applyStyles('dark', { | ||
* background: '#1c1c1c', | ||
* color: '#fff', | ||
* }), | ||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
This section wasn't removed, it was just moved below