Skip to content

Commit b72edf6

Browse files
committed
Fix <Toolbar> design
1 parent 11e2c04 commit b72edf6

File tree

3 files changed

+25
-1
lines changed

3 files changed

+25
-1
lines changed

examples/demo/src/themes/softTheme.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,13 @@ export const softDarkTheme = {
4545
elevation: 1,
4646
},
4747
},
48+
RaToolbar: {
49+
styleOverrides: {
50+
root: {
51+
backgroundColor: '#616161',
52+
},
53+
},
54+
},
4855
},
4956
};
5057

packages/ra-ui-materialui/src/form/Toolbar.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ const StyledToolbar = styled(MuiToolbar, {
108108
name: PREFIX,
109109
overridesResolver: (props, styles) => styles.root,
110110
})(({ theme }) => ({
111-
backgroundColor: (theme.vars || theme).palette.divider,
111+
backgroundColor: (theme.vars || theme).palette.background.paper,
112112

113113
[`&.${ToolbarClasses.desktopToolbar}`]: {},
114114

packages/ra-ui-materialui/src/theme/defaultTheme.ts

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { ThemeOptions } from '@mui/material';
2+
import { grey } from '@mui/material/colors';
23
import { deepmerge } from '@mui/utils';
34

45
const defaultThemeInvariants: ThemeOptions = {
@@ -96,6 +97,13 @@ export const defaultLightTheme: ThemeOptions = deepmerge(
9697
},
9798
},
9899
},
100+
RaToolbar: {
101+
styleOverrides: {
102+
root: {
103+
backgroundColor: grey[100],
104+
},
105+
},
106+
},
99107
},
100108
}
101109
);
@@ -112,6 +120,15 @@ export const defaultDarkTheme: ThemeOptions = deepmerge(
112120
default: '#313131',
113121
},
114122
},
123+
components: {
124+
RaToolbar: {
125+
styleOverrides: {
126+
root: {
127+
backgroundColor: grey[900],
128+
},
129+
},
130+
},
131+
},
115132
}
116133
);
117134

0 commit comments

Comments
 (0)