Skip to content

Commit 1671f13

Browse files
committed
Fix other themes
1 parent af8fca8 commit 1671f13

File tree

6 files changed

+43
-3
lines changed

6 files changed

+43
-3
lines changed

examples/demo/src/themes/softTheme.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { grey } from '@mui/material/colors';
12
import { defaultTheme } from 'react-admin';
23

34
/**
@@ -48,7 +49,7 @@ export const softDarkTheme = {
4849
RaToolbar: {
4950
styleOverrides: {
5051
root: {
51-
backgroundColor: '#616161',
52+
backgroundColor: grey[800],
5253
},
5354
},
5455
},
@@ -128,5 +129,12 @@ export const softLightTheme = {
128129
},
129130
},
130131
},
132+
RaToolbar: {
133+
styleOverrides: {
134+
root: {
135+
backgroundColor: grey[300],
136+
},
137+
},
138+
},
131139
},
132140
};

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,7 @@ const StyledToolbar = styled(MuiToolbar, {
109109
overridesResolver: (props, styles) => styles.root,
110110
})(({ theme }) => ({
111111
backgroundColor: (theme.vars || theme).palette.background.paper,
112+
backgroundImage: theme.vars != null ? 'var(--Paper-overlay);' : 'none',
112113

113114
[`&.${ToolbarClasses.desktopToolbar}`]: {},
114115

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ export const defaultLightTheme: ThemeOptions = deepmerge(
100100
RaToolbar: {
101101
styleOverrides: {
102102
root: {
103-
backgroundColor: grey[100],
103+
backgroundColor: grey[300],
104104
},
105105
},
106106
},
@@ -124,7 +124,7 @@ export const defaultDarkTheme: ThemeOptions = deepmerge(
124124
RaToolbar: {
125125
styleOverrides: {
126126
root: {
127-
backgroundColor: grey[900],
127+
backgroundColor: grey[800],
128128
},
129129
},
130130
},

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

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import {
66
PaletteOptions,
77
ThemeOptions,
88
} from '@mui/material';
9+
import { grey } from '@mui/material/colors';
910

1011
/**
1112
* House: A young and joyful theme.
@@ -172,6 +173,16 @@ const componentsOverrides = (theme: Theme): ThemeOptions['components'] => ({
172173
},
173174
},
174175
},
176+
RaToolbar: {
177+
styleOverrides: {
178+
root: {
179+
backgroundColor:
180+
theme.palette.mode === 'dark'
181+
? `color-mix(in oklab, ${theme.palette.background.paper} 80%, white)`
182+
: grey[300],
183+
},
184+
},
185+
},
175186
});
176187

177188
const alert = {

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

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import {
44
Theme,
55
ThemeOptions,
66
} from '@mui/material';
7+
import { grey } from '@mui/material/colors';
78

89
/**
910
* Nano: A dense theme with minimal chrome, ideal for complex apps.
@@ -326,6 +327,14 @@ const componentsOverrides = (theme: Theme): ThemeOptions['components'] => ({
326327
fullWidth: true,
327328
},
328329
},
330+
RaToolbar: {
331+
styleOverrides: {
332+
root: {
333+
backgroundColor:
334+
theme.palette.mode === 'dark' ? grey[900] : grey[100],
335+
},
336+
},
337+
},
329338
});
330339

331340
const alert = {

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

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import {
55
Theme,
66
ThemeOptions,
77
} from '@mui/material';
8+
import { grey } from '@mui/material/colors';
89

910
/**
1011
* Radiant: A theme emphasizing clarity and ease of use.
@@ -151,6 +152,16 @@ const componentsOverrides = (theme: Theme): ThemeOptions['components'] => {
151152
},
152153
},
153154
},
155+
RaToolbar: {
156+
styleOverrides: {
157+
root: {
158+
backgroundColor:
159+
theme.palette.mode === 'dark'
160+
? `color-mix(in oklab, ${theme.palette.background.paper} 80%, white)`
161+
: grey[300],
162+
},
163+
},
164+
},
154165
};
155166
};
156167

0 commit comments

Comments
 (0)