Skip to content

Commit

Permalink
adjust the Switch size
Browse files Browse the repository at this point in the history
  • Loading branch information
siriwatknp committed Sep 7, 2023
1 parent 7e51c31 commit a634103
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions packages/mui-joy/src/Switch/Switch.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -66,22 +66,22 @@ const SwitchRoot = styled('div', {
ownerState.variant === 'soft' ? 'none' : '0 0 0 1px var(--Switch-trackBackground)', // create border-like if the thumb is bigger than the track
...(ownerState.size === 'sm' && {
'--Switch-trackWidth': '32px',
'--Switch-trackHeight': '16px',
'--Switch-thumbSize': '8px',
'--Switch-trackHeight': '20px',
'--Switch-thumbSize': '16px',
'--Switch-gap': '6px',
fontSize: theme.vars.fontSize.sm,
}),
...(ownerState.size === 'md' && {
'--Switch-trackWidth': '40px',
'--Switch-trackHeight': '20px',
'--Switch-thumbSize': '12px',
'--Switch-trackHeight': '24px',
'--Switch-thumbSize': '20px',
'--Switch-gap': '8px',
fontSize: theme.vars.fontSize.md,
}),
...(ownerState.size === 'lg' && {
'--Switch-trackWidth': '48px',
'--Switch-trackHeight': '24px',
'--Switch-thumbSize': '16px',
'--Switch-trackHeight': '28px',
'--Switch-thumbSize': '24px',
'--Switch-gap': '12px',
}),
'--unstable_paddingBlock': `max((var(--Switch-trackHeight) - 2 * var(--variant-borderWidth, 0px) - var(--Switch-thumbSize)) / 2, 0px)`,
Expand Down

0 comments on commit a634103

Please sign in to comment.