fix: padding in the Switch button of Page/Edgeless (#3542)

This commit is contained in:
Pratik Kumar 2023-08-03 14:08:00 +05:30 committed by GitHub
parent 78d23d86f5
commit 3282344d4a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -5,14 +5,15 @@ export const StyledEditorModeSwitch = styled('div')<{
showAlone?: boolean; showAlone?: boolean;
}>(({ switchLeft, showAlone }) => { }>(({ switchLeft, showAlone }) => {
return { return {
width: showAlone ? '40px' : '78px', maxWidth: showAlone ? '40px' : '70px',
gap: '8px',
height: '32px', height: '32px',
background: showAlone background: showAlone
? 'transparent' ? 'transparent'
: 'var(--affine-background-secondary-color)', : 'var(--affine-background-secondary-color)',
borderRadius: '12px', borderRadius: '12px',
...displayFlex('space-between', 'center'), ...displayFlex('space-between', 'center'),
padding: '0 8px', padding: '4px 4px',
position: 'relative', position: 'relative',
'::after': { '::after': {
@ -25,7 +26,7 @@ export const StyledEditorModeSwitch = styled('div')<{
borderRadius: '8px', borderRadius: '8px',
zIndex: 1, zIndex: 1,
position: 'absolute', position: 'absolute',
transform: `translateX(${switchLeft ? '0' : '38px'})`, transform: `translateX(${switchLeft ? '0' : '32px'})`,
transition: 'all .15s', transition: 'all .15s',
}, },
}; };