Skip to content

Commit b5684ef

Browse files
committed
Remove default styles from bulk actions buttons
1 parent c47cc57 commit b5684ef

File tree

6 files changed

+6
-52
lines changed

6 files changed

+6
-52
lines changed

packages/ra-ui-materialui/src/button/BulkDeleteWithConfirmButton.tsx

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -197,16 +197,7 @@ const PREFIX = 'RaBulkDeleteWithConfirmButton';
197197
const StyledButton = styled(Button, {
198198
name: PREFIX,
199199
overridesResolver: (props, styles) => styles.root,
200-
})(({ theme }) => ({
201-
color: (theme.vars || theme).palette.error.main,
202-
'&:hover': {
203-
backgroundColor: `color-mix(in srgb, ${(theme.vars || theme).palette.error.main}, transparent 12%)`,
204-
// Reset on mouse devices
205-
'@media (hover: none)': {
206-
backgroundColor: 'transparent',
207-
},
208-
},
209-
}));
200+
})(() => ({}));
210201

211202
const defaultIcon = <ActionDelete />;
212203

packages/ra-ui-materialui/src/button/BulkDeleteWithUndoButton.tsx

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,7 @@ export const BulkDeleteWithUndoButton = (
9898
onClick={handleClick}
9999
label={label}
100100
disabled={isPending}
101+
color="error"
101102
{...sanitizeRestProps(rest)}
102103
>
103104
{icon}
@@ -131,16 +132,7 @@ const PREFIX = 'RaBulkDeleteWithUndoButton';
131132
const StyledButton = styled(Button, {
132133
name: PREFIX,
133134
overridesResolver: (props, styles) => styles.root,
134-
})(({ theme }) => ({
135-
color: (theme.vars || theme).palette.error.main,
136-
'&:hover': {
137-
backgroundColor: `color-mix(in srgb, ${(theme.vars || theme).palette.error.main}, transparent 12%)`,
138-
// Reset on mouse devices
139-
'@media (hover: none)': {
140-
backgroundColor: 'transparent',
141-
},
142-
},
143-
}));
135+
})(() => ({}));
144136

145137
declare module '@mui/material/styles' {
146138
interface ComponentNameToClassKey {

packages/ra-ui-materialui/src/button/BulkUpdateWithConfirmButton.tsx

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -195,16 +195,7 @@ const PREFIX = 'RaBulkUpdateWithConfirmButton';
195195
const StyledButton = styled(Button, {
196196
name: PREFIX,
197197
overridesResolver: (props, styles) => styles.root,
198-
})(({ theme }) => ({
199-
color: (theme.vars || theme).palette.primary.main,
200-
'&:hover': {
201-
backgroundColor: `color-mix(in srgb, ${(theme.vars || theme).palette.primary.main}, transparent 12%)`,
202-
// Reset on mouse devices
203-
'@media (hover: none)': {
204-
backgroundColor: 'transparent',
205-
},
206-
},
207-
}));
198+
})(() => ({}));
208199

209200
const defaultIcon = <ActionUpdate />;
210201

packages/ra-ui-materialui/src/button/BulkUpdateWithUndoButton.tsx

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -141,16 +141,7 @@ const PREFIX = 'RaBulkUpdateWithUndoButton';
141141
const StyledButton = styled(Button, {
142142
name: PREFIX,
143143
overridesResolver: (props, styles) => styles.root,
144-
})(({ theme }) => ({
145-
color: (theme.vars || theme).palette.primary.main,
146-
'&:hover': {
147-
backgroundColor: `color-mix(in srgb, ${(theme.vars || theme).palette.primary.main}, transparent 12%)`,
148-
// Reset on mouse devices
149-
'@media (hover: none)': {
150-
backgroundColor: 'transparent',
151-
},
152-
},
153-
}));
144+
})(() => ({}));
154145

155146
declare module '@mui/material/styles' {
156147
interface ComponentNameToClassKey {

packages/ra-ui-materialui/src/button/SelectAllButton.tsx

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -107,15 +107,7 @@ const PREFIX = 'RaSelectAllButton';
107107
const StyledButton = styled(Button, {
108108
name: PREFIX,
109109
overridesResolver: (props, styles) => styles.root,
110-
})(({ theme }) => ({
111-
'&:hover': {
112-
backgroundColor: `color-mix(in srgb, ${(theme.vars || theme).palette.primary.main}, transparent 12%)`,
113-
// Reset on mouse devices
114-
'@media (hover: none)': {
115-
backgroundColor: 'transparent',
116-
},
117-
},
118-
}));
110+
})(() => ({}));
119111

120112
declare module '@mui/material/styles' {
121113
interface ComponentNameToClassKey {

packages/ra-ui-materialui/src/list/BulkActionsToolbar.tsx

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -163,9 +163,6 @@ const Root = styled('div', {
163163

164164
[`& .${BulkActionsToolbarClasses.icon}`]: {
165165
marginLeft: '-0.5em',
166-
'&:hover': {
167-
backgroundColor: `color-mix(in srgb, ${(theme.vars || theme).palette.primary.main}, transparent 12%)`,
168-
},
169166
},
170167
}));
171168

0 commit comments

Comments
 (0)