Skip to content

Commit

Permalink
Style: Theme components - to keep style consistent
Browse files Browse the repository at this point in the history
  • Loading branch information
enricoros committed Oct 24, 2023
1 parent d2217eb commit f8e23b4
Showing 1 changed file with 62 additions and 0 deletions.
62 changes: 62 additions & 0 deletions src/common/theme.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,68 @@ export const theme = extendTheme({
},
},
},
components: {
/**
* IconButton
* - enlarge 'md' a bit: https://github.com/mui/material-ui/commit/7f81475ea148a416ec8fab252120ce6567c62897#diff-45dca083057933d78377b59e031146804cfedb68fe1514955bc8a5b3c38d7c44
*/
JoyIconButton: {
styleOverrides: {
root: ({ ownerState }) => ({
...(ownerState.instanceSize && {
'--IconButton-size': { sm: '2rem', md: '2.5rem', lg: '3rem' }[ownerState.instanceSize],
}),
...(ownerState.size === 'md' && {
'--Icon-fontSize': 'calc(var(--IconButton-size, 2.5rem) / 1.667)',
'--CircularProgress-size': '24px',
'--CircularProgress-thickness': '3px',
minWidth: 'var(--IconButton-size, 2.5rem)',
minHeight: 'var(--IconButton-size, 2.5rem)',
}),
}),
},
},

/**
* Input
* - remove the box-shadow: https://github.com/mui/material-ui/commit/8d4728df8a66d710660af96ac7ff3f86d2d26382
*/
JoyInput: {
styleOverrides: {
root: {
boxShadow: 'none',
},
},
},

/**
* Select
* - remove the box-shadow: https://github.com/mui/material-ui/commit/8d4728df8a66d710660af96ac7ff3f86d2d26382
* */
JoySelect: {
styleOverrides: {
root: {
boxShadow: 'none',
},
},
},

/**
* Switch: increase the size of the thumb, to a default iconButton
* NOTE: do not use anything else than 'md' size
*/
JoySwitch: {
styleOverrides: {
root: ({ ownerState }) => ({
...(ownerState.size === 'md' && {
'--Switch-trackWidth': '40px',
'--Switch-trackHeight': '24px',
'--Switch-thumbSize': '18px',
}),
}),
},
},
},
});

export const bodyFontClassName = inter.className;
Expand Down

1 comment on commit f8e23b4

@vercel
Copy link

@vercel vercel bot commented on f8e23b4 Oct 24, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

big-agi – ./

big-agi-enricoros.vercel.app
get.big-agi.com
big-agi-git-main-enricoros.vercel.app

Please sign in to comment.