Skip to content

Commit 009545e

Browse files
fzaninottodjhi
authored andcommitted
Disable ripple effect
Closes #5587
1 parent 12a40fb commit 009545e

File tree

2 files changed

+78
-0
lines changed

2 files changed

+78
-0
lines changed

examples/demo/src/layout/themes.ts

+52
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,32 @@ export const darkTheme = {
1515
backgroundColor: '#616161e6',
1616
},
1717
},
18+
MuiButtonBase: {
19+
root: {
20+
'&:hover:active::after': {
21+
// recreate a static ripple color
22+
// use the currentColor to make it work both for outlined and contained buttons
23+
// but to dim the background without dimming the text,
24+
// put another element on top with a limited opacity
25+
content: '""',
26+
display: 'block',
27+
width: '100%',
28+
height: '100%',
29+
position: 'absolute',
30+
top: 0,
31+
right: 0,
32+
backgroundColor: 'currentColor',
33+
opacity: 0.3,
34+
borderRadius: 'inherit',
35+
},
36+
},
37+
},
38+
},
39+
props: {
40+
MuiButtonBase: {
41+
// disable ripple for perf reasons
42+
disableRipple: true,
43+
},
1844
},
1945
};
2046

@@ -62,6 +88,26 @@ export const lightTheme = {
6288
boxShadow: 'none',
6389
},
6490
},
91+
MuiButtonBase: {
92+
root: {
93+
'&:hover:active::after': {
94+
// recreate a static ripple color
95+
// use the currentColor to make it work both for outlined and contained buttons
96+
// but to dim the background without dimming the text,
97+
// put another element on top with a limited opacity
98+
content: '""',
99+
display: 'block',
100+
width: '100%',
101+
height: '100%',
102+
position: 'absolute',
103+
top: 0,
104+
right: 0,
105+
backgroundColor: 'currentColor',
106+
opacity: 0.3,
107+
borderRadius: 'inherit',
108+
},
109+
},
110+
},
65111
MuiAppBar: {
66112
colorSecondary: {
67113
color: '#808080',
@@ -85,4 +131,10 @@ export const lightTheme = {
85131
},
86132
},
87133
},
134+
props: {
135+
MuiButtonBase: {
136+
// disable ripple for perf reasons
137+
disableRipple: true,
138+
},
139+
},
88140
};

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

+26
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,32 @@ export default {
2828
},
2929
},
3030
},
31+
MuiButtonBase: {
32+
root: {
33+
'&:hover:active::after': {
34+
// recreate a static ripple color
35+
// use the currentColor to make it work both for outlined and contained buttons
36+
// but to dim the background without dimming the text,
37+
// put another element on top with a limited opacity
38+
content: '""',
39+
display: 'block',
40+
width: '100%',
41+
height: '100%',
42+
position: 'absolute',
43+
top: 0,
44+
right: 0,
45+
backgroundColor: 'currentColor',
46+
opacity: 0.3,
47+
borderRadius: 'inherit',
48+
},
49+
},
50+
},
51+
},
52+
props: {
53+
MuiButtonBase: {
54+
// disable ripple for perf reasons
55+
disableRipple: true,
56+
},
3157
},
3258
};
3359

0 commit comments

Comments
 (0)