Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Map Typography variants to span element #280

Merged
merged 1 commit into from
Dec 9, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
63 changes: 39 additions & 24 deletions src/theme.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,44 @@ const _theme = createTheme({
subtitle1: undefined,
subtitle2: undefined,
},
components: {
MuiTypography: {
defaultProps: {
variantMapping: {
body1: 'span',
body2: 'span',
body3: 'span',
button1: 'span',
button2: 'span',
button3: 'span',
postTitle: 'span',
postBody: 'span',
},
},
},
MuiDialog: {
styleOverrides: {
paper: {
'& > div.MuiDialogContent-root': {paddingTop: '20px'},
border: '10px solid black',
},
},
},
MuiDialogActions: {
styleOverrides: {
root: {
paddingBottom: '20px',
},
},
},
MuiDialogTitle: {
styleOverrides: {
root: {
textAlign: 'center',
},
},
},
},
})

const pxToRem = _theme.typography.pxToRem
Expand All @@ -64,6 +102,7 @@ const md = _theme.breakpoints.up('md') // 900px
const lg = _theme.breakpoints.up('lg') // 1200px
const xl = _theme.breakpoints.up('xl') // 1536px

// manual font sizes
export const theme: Theme = {
..._theme,
typography: {
Expand Down Expand Up @@ -175,28 +214,4 @@ export const theme: Theme = {
[xl]: {fontSize: pxToRem(30)},
},
},
components: {
MuiDialog: {
styleOverrides: {
paper: {
'& > div.MuiDialogContent-root': {paddingTop: '20px'},
border: '10px solid black',
},
},
},
MuiDialogActions: {
styleOverrides: {
root: {
paddingBottom: '20px',
},
},
},
MuiDialogTitle: {
styleOverrides: {
root: {
textAlign: 'center',
},
},
},
},
}
Loading