Skip to content

Commit a9b7ae6

Browse files
authored
[docs] Fix incorrect Typography override example for responsive styles (#46558)
1 parent 87dda6a commit a9b7ae6

File tree

1 file changed

+13
-9
lines changed

1 file changed

+13
-9
lines changed

docs/data/material/customization/typography/typography.md

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -115,17 +115,21 @@ The `theme.typography.*` [variant](#variants) properties map directly to the gen
115115
You can use [media queries](/material-ui/customization/breakpoints/#api) inside them:
116116

117117
```js
118-
const theme = createTheme();
118+
const baseTheme = createTheme();
119119

120-
theme.typography.h3 = {
121-
fontSize: '1.2rem',
122-
'@media (min-width:600px)': {
123-
fontSize: '1.5rem',
124-
},
125-
[theme.breakpoints.up('md')]: {
126-
fontSize: '2.4rem',
120+
const theme = createTheme({
121+
typography: {
122+
h3: {
123+
fontSize: '1.2rem',
124+
'@media (min-width:600px)': {
125+
fontSize: '1.5rem',
126+
},
127+
[baseTheme.breakpoints.up('md')]: {
128+
fontSize: '2.4rem',
129+
},
130+
},
127131
},
128-
};
132+
});
129133
```
130134

131135
{{"demo": "CustomResponsiveFontSizes.js"}}

0 commit comments

Comments
 (0)