tldraw/components/shared.tsx

63 lines
1 KiB
TypeScript
Raw Normal View History

import styled from 'styles'
2021-05-17 10:01:11 +00:00
export const IconButton = styled('button', {
height: '32px',
width: '32px',
backgroundColor: '$panel',
borderRadius: '4px',
padding: '0',
margin: '0',
display: 'grid',
alignItems: 'center',
justifyContent: 'center',
outline: 'none',
border: 'none',
pointerEvents: 'all',
cursor: 'pointer',
2021-05-17 10:01:11 +00:00
'& > *': {
gridRow: 1,
gridColumn: 1,
},
'&:hover:not(:disabled)': {
backgroundColor: '$hover',
2021-05-17 10:01:11 +00:00
},
'&:disabled': {
opacity: '0.5',
2021-05-17 10:01:11 +00:00
},
variants: {
size: {
small: {
'& > svg': {
height: '16px',
width: '16px',
},
},
medium: {
height: 44,
width: 44,
'& > svg': {
height: '16px',
width: '16px',
},
},
large: {
height: 44,
width: 44,
'& > svg': {
height: '24px',
width: '24px',
},
},
},
isActive: {
true: {
color: '$selected',
},
},
2021-05-17 10:01:11 +00:00
},
})