forked from molily/selectionmenu
-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathiDoRecall-menu.less
207 lines (178 loc) · 5.82 KB
/
iDoRecall-menu.less
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
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
@backgroundColor: #464646;
@arrowSize: 16px;
.selection-menu {
font: 20px/100% Roboto, sans-serif;
// background: @backgroundColor; // enable if removing the arrows theme
color: white;
text-transform: uppercase;
position: absolute;
padding: 0;
img {
width: 37px;
}
&:hover {
color: #B3B3B3;
}
}
.selection-menu ul {
list-style-type: none;
display: flex; /* gets rid of the space between inline-block elements: https://css-tricks.com/fighting-the-space-between-inline-block-elements/ */
margin: 0;
padding: 0;
}
.selection-menu li {
all: unset; // reset all CSS properties, except in Safari - https://twitter.com/LeaVerou/status/577390241763467264
cursor: pointer;
display: inline-block;
margin: 0;
padding: .75em 1em;
border-left: 3px solid #666666;
-webkit-user-select: none;
-webkit-touch-callout: none;
-moz-user-select: none;
&.shortcut {
font-weight: bold;
}
// the logo
&:first-child {
border: none;
padding: 0 .4em; /* or padding 0 & margin auto .4em but the hover selection is smaller */
margin: auto;
align-self: center; /* For IE10; Chrome acts correctly on margin+padding alone */
}
a {
display: inline-block;
}
&:hover {
background: #3FA9F5;
color: white;
}
background: none; // Safari doesn't do `all: unset` - https://twitter.com/LeaVerou/status/577390241763467264
}
/* don't highlight the image */
.selection-menu li:first-child:hover {
background: transparent;
}
// Taken from the arrows theme, https://github.com/HubSpot/tether/blob/master/src/css/helpers/_tether-theme-arrows.sass. Only uses @backgroundColor
.tether-smenu-element, .tether-smenu-element:after, .tether-smenu-element:before, .tether-smenu-element *, .tether-smenu-element *:after, .tether-smenu-element *:before {
box-sizing: border-box;
}
.tether-smenu-element {
> * {
position: relative;
background: @backgroundColor;
-webkit-filter: drop-shadow(0 20px 20px rgba(0, 0, 0, 0.7)); // subtle 3D
filter: drop-shadow(0 20px 20px rgba(0, 0, 0, 0.7));
// TODO box-shadow is more cross-browser: http://thenewcode.com/598/boxshadow-property-vs-dropshadow-filter-a-complete-comparison
&:before {
content: "";
display: block;
position: absolute;
width: 0;
height: 0;
border-color: transparent;
border-width: @arrowSize;
border-style: solid;
}
}
}
.tether-smenu-element.tether-smenu-element-attached-bottom.tether-smenu-element-attached-center > ul {
margin-bottom: @arrowSize;
&:before {
top: 100%;
left: 50%;
margin-left: -@arrowSize;
border-top-color: @backgroundColor;
}
}
.tether-smenu-element.tether-smenu-element-attached-top.tether-smenu-element-attached-center > * {
margin-top: @arrowSize;
&:before {
bottom: 100%;
left: 50%;
margin-left: -@arrowSize;
border-bottom-color: @backgroundColor;
}
}
.tether-smenu-element.tether-smenu-element-attached-right.tether-smenu-element-attached-middle > * {
margin-right: @arrowSize;
&:before {
left: 100%;
top: 50%;
margin-top: -@arrowSize;
border-left-color: @backgroundColor;
}
}
.tether-smenu-element.tether-smenu-element-attached-left.tether-smenu-element-attached-middle > * {
margin-left: @arrowSize;
&:before {
right: 100%;
top: 50%;
margin-top: -@arrowSize;
border-right-color: @backgroundColor;
}
}
.tether-smenu-element.tether-smenu-element-attached-top.tether-smenu-element-attached-left.tether-smenu-target-attached-bottom > * {
margin-top: @arrowSize;
&:before {
bottom: 100%;
left: @arrowSize;
border-bottom-color: @backgroundColor;
}
}
.tether-smenu-element.tether-smenu-element-attached-top.tether-smenu-element-attached-right.tether-smenu-target-attached-bottom > * {
margin-top: @arrowSize;
&:before {
bottom: 100%;
right: @arrowSize;
border-bottom-color: @backgroundColor;
}
}
.tether-smenu-element.tether-smenu-element-attached-bottom.tether-smenu-element-attached-left.tether-smenu-target-attached-top > * {
margin-bottom: @arrowSize;
&:before {
top: 100%;
left: @arrowSize;
border-top-color: @backgroundColor;
}
}
.tether-smenu-element.tether-smenu-element-attached-bottom.tether-smenu-element-attached-right.tether-smenu-target-attached-top > * {
margin-bottom: @arrowSize;
&:before {
top: 100%;
right: @arrowSize;
border-top-color: @backgroundColor;
}
}
.tether-smenu-element.tether-smenu-element-attached-top.tether-smenu-element-attached-right.tether-smenu-target-attached-left > * {
margin-right: @arrowSize;
&:before {
top: @arrowSize;
left: 100%;
border-left-color: @backgroundColor;
}
}
.tether-smenu-element.tether-smenu-element-attached-top.tether-smenu-element-attached-left.tether-smenu-target-attached-right > * {
margin-left: @arrowSize;
&:before {
top: @arrowSize;
right: 100%;
border-right-color: @backgroundColor;
}
}
.tether-smenu-element.tether-smenu-element-attached-bottom.tether-smenu-element-attached-right.tether-smenu-target-attached-left > * {
margin-right: @arrowSize;
&:before {
bottom: @arrowSize;
left: 100%;
border-left-color: @backgroundColor;
}
}
.tether-smenu-element.tether-smenu-element-attached-bottom.tether-smenu-element-attached-left.tether-smenu-target-attached-right > * {
margin-left: @arrowSize;
&:before {
bottom: @arrowSize;
right: 100%;
border-right-color: @backgroundColor;
}
}