-
Notifications
You must be signed in to change notification settings - Fork 24
Expand file tree
/
Copy pathmenu.css.ts
More file actions
146 lines (133 loc) · 3.35 KB
/
Copy pathmenu.css.ts
File metadata and controls
146 lines (133 loc) · 3.35 KB
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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
import {createVar, style} from '@vanilla-extract/css';
import {sprinkles} from './sprinkles.css';
import {vars as skinVars} from './skins/skin-contract.css';
import * as mq from './media-queries.css';
const top = createVar();
const bottom = createVar();
const left = createVar();
const width = createVar();
const right = createVar();
const maxHeight = createVar();
const transformOrigin = createVar();
const MENU_MIN_WIDTH = 136;
const MENU_MAX_WIDTH = 280;
export const vars = {
top,
bottom,
left,
right,
width,
maxHeight,
transformOrigin,
};
export const menuContainer = style([
sprinkles({
padding: 8,
background: skinVars.colors.backgroundContainer,
borderRadius: skinVars.borderRadii.popup,
display: 'flex',
flexDirection: 'column',
position: 'absolute',
}),
{
top,
bottom,
left,
right,
width,
minWidth: MENU_MIN_WIDTH,
maxWidth: MENU_MAX_WIDTH,
maxHeight,
transformOrigin,
listStyleType: 'none',
margin: 0,
overflowY: 'auto',
boxShadow: '0px 2px 4px rgba(0,0,0,0.2)',
},
]);
export const menuTransitionClasses = {
enter: style({
opacity: 0,
transform: 'scale(0)',
}),
enterActive: style({
opacity: 1,
transform: 'scale(1)',
transition: 'opacity .12s linear,transform .12s cubic-bezier(0,0,.2,1)',
}),
exit: style({
opacity: 1,
}),
exitActive: style({
opacity: 0,
transition: 'opacity .12s linear',
}),
};
export const menuItem = style({
userSelect: 'none',
transition: 'background-color 0.1s ease-in-out',
borderRadius: skinVars.borderRadii.popup,
backgroundColor: 'transparent',
'@media': {
[mq.touchableOnly]: {
transition: 'none',
},
},
});
export const menuItemHovered = style({
transition: 'background-color 0.1s ease-in-out',
backgroundColor: skinVars.colors.backgroundContainerHover,
':active': {
backgroundColor: skinVars.colors.backgroundContainerPressed,
},
'@media': {
[mq.touchableOnly]: {
backgroundColor: 'transparent',
transition: 'none',
},
},
});
export const menuItemHoveredDestructive = style({
transition: 'background-color 0.1s ease-in-out',
backgroundColor: skinVars.colors.buttonLinkDangerBackgroundPressed,
':active': {
backgroundColor: skinVars.colors.buttonLinkDangerBackgroundPressed,
},
'@media': {
[mq.touchableOnly]: {
backgroundColor: 'transparent',
transition: 'none',
},
},
});
export const menuItemEnabled = style({
'@media': {
[mq.touchableOnly]: {
selectors: {
'&:active:not([menuItemDisabled])': {
backgroundColor: skinVars.colors.backgroundContainerPressed,
},
},
},
},
});
export const menuItemDisabled = style({
userSelect: 'none',
opacity: 0.5,
});
export const menuSectionDivider = style([
sprinkles({paddingY: 8}),
{
':last-child': {
display: 'none',
},
},
]);
export const itemContent = style({
display: 'flex',
alignItems: 'center',
});
export const iconContainer = style({
display: 'flex',
paddingRight: 8,
});