This repository has been archived by the owner on Dec 11, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 975
/
contextMenu.less
180 lines (156 loc) · 3.52 KB
/
contextMenu.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
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
* You can obtain one at http://mozilla.org/MPL/2.0/. */
@import "variables.less";
:root {
--context-menu-single-max-width: 400px;
}
.contextMenu {
border-radius: @borderRadius;
box-sizing: border-box;
color: black;
cursor: default;
display: flex;
font-size: @contextMenuFontSize;
&.contextMenuScrollable {
overflow-y: scroll;
}
// This is a reasonable max height and also solves problems for bookmarks menu
// and bookmarks overflow menu reaching down too low.
height: 100%;
width: 100%;
@usedUpChrome: @navbarHeight + @bookmarksToolbarWithFaviconsHeight;
max-height: calc(~'100% - @{usedUpChrome}');
overflow: auto;
position: absolute;
z-index: @zindexContextMenu;
-webkit-user-select: none;
&.reverseExpand {
flex-direction: row-reverse;
}
.contextMenuSingle {
background-color: rgba(238, 238, 238, 1);
border: 1px solid rgba(204, 204, 204, 0.54);
box-shadow: 1px 4px 8px -3px rgba(0, 0, 0, 0.5);
border-radius: @borderRadius;
box-sizing: border-box;
display: table;
min-width: 220px;
max-width: var(--context-menu-single-max-width);
&.isSubmenu {
position: relative;
}
}
.selectedByKeyboard {
background-color: lighten(@menuSelectionColor, 5%);
color: white;
}
.contextMenuIcon {
font-size: 14px;
margin-right: 8px;
&.hasFaIcon {
color: @darkGray;
}
}
}
.contextMenuItem {
max-width: 420px;
padding: 6px 10px 6px 20px;
&.hasIcon {
padding-left: 10px;
&.hasFaIcon {
padding-left: 12px;
}
}
&.checkedMenuItem {
padding-left: 4px;
.contextMenuCheckIndicator {
padding-right: 4px;
}
}
box-sizing: border-box;
display: flex;
align-items: center;
text-overflow: ellipsis;
white-space: nowrap;
overflow: hidden;
-webkit-user-select: none;
&.multiContextMenuItem {
display: flex;
.contextMenuSubItem {
border: 1px solid #aaaaaa;
border-radius: @borderRadius;
background-color: #fbfbfb;
color: black;
flex-grow: 1;
margin: 1px;
padding: 4px;
text-align: center;
}
.multiItemTitle {
margin-top: auto;
margin-bottom: auto;
padding-right: 10px;
}
}
&.contextMenuSeparator {
padding: 1px 0px;
hr {
background-color: #bbb;
border: none;
height: 1px;
width: 100%;
}
}
&:not([disabled]) {
&:not(.contextMenuSeparator) {
&:hover {
background-color: lighten(@menuSelectionColor, 5%);
color: white;
.accelerator,
.submenuIndicator {
color: #fff;
}
}
}
}
&[disabled] {
color: #bbb;
}
.contextMenuItemText {
overflow: hidden;
text-overflow: ellipsis;
}
.submenuIndicatorContainer {
display: flex;
margin: auto 0 auto auto;
.submenuIndicatorSpacer {
flex-grow: 1;
}
.submenuIndicator {
color: #676767;
font-size: 10px;
float: right;
margin: auto 0 auto 5px;
}
.accelerator {
.submenuIndicator;
font-size: @contextMenuFontSize;
margin-left: 10px;
}
}
.fa {
font-size: @bookmarksFolderIconSize;
}
}
// Make context menu style match menubar (Windows only- for use w/ slim titlebar)
.platform--win32 {
.contextMenuItem {
font: menu;
font-size: 12px;
}
.accelerator {
font: menu;
font-size: 12px !important;
}
}