/
MenuItem.styles.ts
58 lines (51 loc) · 1.49 KB
/
MenuItem.styles.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
import { createStyles, MantineColor, MantineNumberSize } from '@mantine/styles';
interface MenuItemStylesParams {
color: MantineColor;
radius: MantineNumberSize;
}
export default createStyles((theme, { color, radius }: MenuItemStylesParams) => ({
item: {
...theme.fn.fontStyles(),
WebkitTapHighlightColor: 'transparent',
fontSize: theme.fontSizes.sm,
border: 0,
backgroundColor: 'transparent',
outline: 0,
width: '100%',
textAlign: 'left',
textDecoration: 'none',
boxSizing: 'border-box',
padding: `${theme.spacing.xs}px ${theme.spacing.sm}px`,
cursor: 'pointer',
borderRadius: theme.fn.radius(radius),
color: color
? theme.fn.variant({ variant: 'filled', primaryFallback: false, color }).background
: theme.colorScheme === 'dark'
? theme.colors.dark[0]
: theme.black,
display: 'flex',
alignItems: 'center',
'&:disabled': {
color: theme.colorScheme === 'dark' ? theme.colors.dark[3] : theme.colors.gray[5],
pointerEvents: 'none',
userSelect: 'none',
},
'&[data-hovered]': {
backgroundColor: color
? theme.fn.variant({ variant: 'light', color }).background
: theme.colorScheme === 'dark'
? theme.fn.rgba(theme.colors.dark[3], 0.35)
: theme.colors.gray[1],
},
},
itemLabel: {
flex: 1,
},
itemIcon: {
display: 'flex',
justifyContent: 'center',
alignItems: 'center',
marginRight: theme.spacing.xs,
},
itemRightSection: {},
}));