/
action-menus.less
266 lines (236 loc) · 7.46 KB
/
action-menus.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
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
//
// Action Menus
// --------------------------------------------------
#menuview {
.navbar {
border-radius: 0;
border: 0;
margin-bottom: 0;
}
.navbar-header {
float: left;
}
.navbar-brand {
float: none;
img {
height: @navbar-height;
display: inline;
}
}
.navbar-nav {
float: right;
> li {
float: right;
}
}
.navbar-form {
margin-left: 0;
margin-right: 0;
padding-top: 0;
padding-bottom: 0;
.box-shadow(none);
}
@media (max-width: @screen-sm-min) {
.dropdown-menu .divider {
background-color: @navbar-default-border;
}
.navbar-left {
float: left;
margin-left: @navbar-padding-horizontal;
margin-right: @navbar-padding-horizontal;
}
}
}
#globalsearch {
margin: 0;
padding: 0;
// Remove the bootstrap border on the form when the screen is small
@media (max-width: @screen-sm-max) {
border: none;
}
.btn {
// When the global search is active, the button has an "hover"-kind color
background-color: @navbar-default-link-hover-bg;
border: 0;
border-radius: 0;
box-shadow: none;
color: @navbar-default-link-color;
margin: 0;
padding: 10px @navbar-padding-horizontal;
@media (min-width: @grid-float-breakpoint) {
padding: @navbar-padding-vertical @navbar-padding-horizontal;
}
&:hover,
&:focus {
background-color: @navbar-default-link-hover-bg;
box-shadow: none;
}
}
// The global search input
#headerglobalsearchinput { // we need to be that specific to be applied
border-radius: 0;
border: 0;
min-width: 0;
transition: width 0.3s, padding 0.3s;
width: 200px; // we need to set a width in pixels otherwise the transition is not applied nicely
}
// When the global search is close
&.globalsearch-close {
// The button is transparent
.btn {
background-color: transparent;
border: 0;
// Except when it is hovering!
&:hover,
&:focus {
background-color: @navbar-default-link-hover-bg;
box-shadow: none;
}
}
// The input has no width (it's hidden basically, but we need to set the width to 0 to have the nice transition)
#headerglobalsearchinput { // we need to be that specific to be applied
padding: 0;
width: 0;
}
}
}
@media (min-width: @screen-sm-min) {
.navbar-nav > li > a {
/* When the page name is long, add ellipsis. */
max-width: 10em;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
}
// Navbar avatar ==========================================================
.navbar-avatar {
> a {
max-height: @navbar-height;
> img {
@avatar-size: floor(ceil(@navbar-height/2)/2)*2;
border-radius: @thumbnail-border-radius;
height: @avatar-size;
margin-top: -@navbar-padding-vertical+@navbar-height/2-@avatar-size/2;
vertical-align: middle;
width: @avatar-size;
}
}
}
// Icon in a navbar ======================================================
.icon-navbar {
cursor: pointer;
}
// Navbar dropdown ========================================================
@media (min-width: @screen-sm-min) {
// We use mixin guards to simulate conditional assignment. We need the hover and active background color to fall back
// on the default background color if transparent (e.g. if the user doesn't specify it in the color theme).
.navbar-dropdown(@bg; @hover-bg; @active-bg) when not (@bg = transparent) and (@hover-bg = transparent) {
// Make sure the hover background color falls back on the default background color.
.navbar-dropdown(@bg, @bg, @active-bg)
}
.navbar-dropdown(@bg; @hover-bg; @active-bg) when not (@bg = transparent) and not (@hover-bg = transparent) and (@active-bg = transparent) {
// Make sure the active background color falls back on the default background color.
.navbar-dropdown(@bg, @hover-bg, @bg)
}
.navbar-dropdown(@bg; @hover-bg; @active-bg) when not (@bg = transparent) and not (@hover-bg = transparent) and not (@active-bg = transparent) {
@navbar-dropdown-contrast: 30%;
@separator-color: contrast(@bg,
darken(@bg, @navbar-dropdown-contrast),
lighten(@bg, @navbar-dropdown-contrast));
@separator-hover-color: contrast(@hover-bg,
darken(@hover-bg, @navbar-dropdown-contrast),
lighten(@hover-bg, @navbar-dropdown-contrast));
@separator-active-color: contrast(@active-bg,
darken(@active-bg, @navbar-dropdown-contrast),
lighten(@active-bg, @navbar-dropdown-contrast));
> a {
/**
* We have two anchors in the same menu entry: one has the label and the caret for extra small screens (phones,
* where the menu is displayed vertically) and the other has the caret for larger screens (where the menu is
* displayed horizontally).
*/
float: left;
}
> .dropdown-split-left {
/* Display it closer to the menu toggle. */
padding-right: ceil(@navbar-padding-horizontal / 2);
> .caret {
/* Hide the caret used for extra small screens. */
display: none;
}
/* The separator between the label and the toggle. */
&:after {
background-color: @separator-color;
content: "";
display: inline-block;
height: @line-height-computed;
position: absolute;
right: 0;
top: @navbar-padding-vertical;
width: 1px;
}
&:hover:after {
/* Update the separator color based on the hover color. */
background-color: @separator-hover-color;
}
&:focus:after,
&:active:after {
/* Update the separator color based on the active color. */
background-color: @separator-active-color;
}
}
> .dropdown-split-right {
/* Display it closer to the menu label. */
padding-left: ceil(@navbar-padding-horizontal / 2);
> .caret {
/* Reset the left margin for the caret used on large screens. */
margin-left: 0;
}
}
&.open > .dropdown-split-left {
/* Highlight only the toggle (right side) when the menu is open. */
background-color: transparent;
color: @navbar-default-link-color;
&:hover {
/* The link can be hovered when the menu is open because only the toggle is active. */
background-color: @navbar-default-link-hover-bg;
color: @navbar-default-link-hover-color;
}
}
}
.navbar-nav > .dropdown-split {
.navbar-dropdown(@navbar-default-bg, @navbar-default-link-hover-bg, @navbar-default-link-active-bg)
}
}
// XWikiMainMenu dropdown menus =======================================
#xwikimainmenu .dropdown-menu {
background-color: @dropdown-bg;
}
// Content menu ======================================================
#contentmenu {
.text-right();
.dropdown {
display: inline-block;
font-size: @font-size-large;
width: @font-size-large * 2.5;
> a {
color: @headings-color;
padding: @font-size-large;
}
}
// Used a mix of LESS variables in order to assure the content buttons
// have a styling more similar to breadcrumbs than buttons, while looking
// decent across the bundled color themes
.btn-default {
background-color: @breadcrumb-bg;
background-image: none;
border-color: @dropdown-divider-bg;
box-shadow: none;
color: @dropdown-link-color;
text-shadow: none;
}
.btn-default:hover, .btn-default:active, .open .dropdown-toggle {
border-color: darken(@dropdown-divider-bg, 10%);
}
}