Skip to content

Commit 6727703

Browse files
committed
replaced classes
1 parent f930783 commit 6727703

4 files changed

Lines changed: 35 additions & 37 deletions

File tree

docs/data/material/customization/theme-components/GlobalCss.js

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,23 @@
11
import { createTheme, ThemeProvider } from '@mui/material/styles';
2-
import Button from '@mui/material/Button';
2+
import Button, { buttonClasses } from '@mui/material/Button';
33

44
const theme = createTheme({
55
components: {
66
MuiButton: {
77
// Style sheet name ⚛️
88
styleOverrides: {
99
// Name of the rule
10-
textPrimary: {
11-
// Some CSS
12-
background: 'linear-gradient(45deg, #FE6B8B 30%, #FF8E53 90%)',
13-
borderRadius: 3,
14-
border: 0,
15-
color: 'white',
16-
height: 48,
17-
padding: '0 30px',
18-
boxShadow: '0 3px 5px 2px rgba(255, 105, 135, .3)',
10+
root: {
11+
[`&.${buttonClasses.text}.${buttonClasses.colorPrimary}`]: {
12+
// Some CSS
13+
background: 'linear-gradient(45deg, #FE6B8B 30%, #FF8E53 90%)',
14+
borderRadius: 3,
15+
border: 0,
16+
color: 'white',
17+
height: 48,
18+
padding: '0 30px',
19+
boxShadow: '0 3px 5px 2px rgba(255, 105, 135, .3)',
20+
},
1921
},
2022
},
2123
},

docs/data/material/customization/theme-components/GlobalCss.tsx

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,23 @@
11
import { createTheme, ThemeProvider } from '@mui/material/styles';
2-
import Button from '@mui/material/Button';
2+
import Button, { buttonClasses } from '@mui/material/Button';
33

44
const theme = createTheme({
55
components: {
66
MuiButton: {
77
// Style sheet name ⚛️
88
styleOverrides: {
99
// Name of the rule
10-
textPrimary: {
11-
// Some CSS
12-
background: 'linear-gradient(45deg, #FE6B8B 30%, #FF8E53 90%)',
13-
borderRadius: 3,
14-
border: 0,
15-
color: 'white',
16-
height: 48,
17-
padding: '0 30px',
18-
boxShadow: '0 3px 5px 2px rgba(255, 105, 135, .3)',
10+
root: {
11+
[`&.${buttonClasses.text}.${buttonClasses.colorPrimary}`]: {
12+
// Some CSS
13+
background: 'linear-gradient(45deg, #FE6B8B 30%, #FF8E53 90%)',
14+
borderRadius: 3,
15+
border: 0,
16+
color: 'white',
17+
height: 48,
18+
padding: '0 30px',
19+
boxShadow: '0 3px 5px 2px rgba(255, 105, 135, .3)',
20+
},
1921
},
2022
},
2123
},

docs/src/components/action/MaterialVsCustomToggle.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ export default function MaterialVsCustomToggle({
3131
padding: '1px 8px',
3232
fontSize: theme.typography.pxToRem(12),
3333
},
34-
'& .MuiButton-outlinedPrimary': {
34+
[`& .${buttonClasses.outlined}.${buttonClasses.colorPrimary}`]: {
3535
backgroundColor: alpha(theme.palette.primary[900], 0.5),
3636
},
3737
})}

docs/src/components/home/MaterialDesignComponents.tsx

Lines changed: 10 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import {
1010
import { capitalize } from '@mui/material/utils';
1111
import Alert from '@mui/material/Alert';
1212
import Box from '@mui/material/Box';
13-
import Button from '@mui/material/Button';
13+
import Button, { buttonClasses } from '@mui/material/Button';
1414
import Chip from '@mui/material/Chip';
1515
import Tabs from '@mui/material/Tabs';
1616
import Menu from '@mui/material/Menu';
@@ -228,6 +228,15 @@ export function buildTheme(): ThemeOptions {
228228
fontSize: '0.875rem',
229229
lineHeight: 24 / 16,
230230
textTransform: 'none',
231+
[`&.${buttonClasses.sizeSmall} > .${buttonClasses.icon}`]: {
232+
fontSize: '0.875rem',
233+
},
234+
[`&.${buttonClasses.sizeMedium} > .${buttonClasses.icon}`]: {
235+
fontSize: '0.875rem',
236+
},
237+
[`&.${buttonClasses.sizeLarge} > .${buttonClasses.icon}`]: {
238+
fontSize: '1rem',
239+
},
231240
},
232241
sizeSmall: ({ theme }) => ({
233242
padding: theme.spacing(0.5, 1),
@@ -264,21 +273,6 @@ export function buildTheme(): ThemeOptions {
264273
borderColor: alpha(theme.palette.primary[300], 0.5),
265274
}),
266275
}),
267-
iconSizeSmall: {
268-
'& > *:nth-of-type(1)': {
269-
fontSize: '0.875rem',
270-
},
271-
},
272-
iconSizeMedium: {
273-
'& > *:nth-of-type(1)': {
274-
fontSize: '0.875rem',
275-
},
276-
},
277-
iconSizeLarge: {
278-
'& > *:nth-of-type(1)': {
279-
fontSize: '1rem',
280-
},
281-
},
282276
},
283277
},
284278
MuiAlert: {

0 commit comments

Comments
 (0)