Skip to content

Commit

Permalink
Use sx prop applystyles array syntax in docs
Browse files Browse the repository at this point in the history
  • Loading branch information
DiegoAndai committed Dec 20, 2024
1 parent be9b07b commit 464ffb4
Showing 1 changed file with 15 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -136,22 +136,26 @@ If you have such a condition, replace it with the [`theme.applyStyles()` functio
function App() {
return (
<Card
sx={(theme) => ({
- sx={(theme) => ({
- backgroundColor: theme.palette.mode === 'dark' ? '#000' : '#fff',
- '&:hover': {
- backgroundColor: theme.palette.mode === 'dark' ? '#333' : '#f5f5f5',
- },
+ backgroundColor: '#fff',
+ '&:hover': {
+ backgroundColor: '#f5f5f5',
+ ...theme.applyStyles('dark', {
+ backgroundColor: '#333',
- })}
+ sx={(theme) => [
+ {
+ backgroundColor: '#fff',
+ '&:hover': {
+ backgroundColor: '#f5f5f5',
+ },
+ },
+ theme.applyStyles('dark', {
+ backgroundColor: '#000',
+ '&:hover': {
+ backgroundColor: '#333',
+ },
+ }),
+ },
+ ...theme.applyStyles('dark', {
+ backgroundColor: '#000',
+ }),
})}
+ ]}
/>
);
}
Expand Down

0 comments on commit 464ffb4

Please sign in to comment.