-
Notifications
You must be signed in to change notification settings - Fork 275
/
menu.less
191 lines (156 loc) · 3.2 KB
/
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
/*! Icinga Web 2 | (c) 2013-2015 Icinga Development Team | GPLv2+ */
@icon-width: 1.2em; // 1em width + 0.2em right margin
#menu {
height: 100%;
overflow: auto;
}
#menu a {
overflow: hidden;
padding: @vertical-padding / 2 @horizontal-padding;
text-overflow: ellipsis;
white-space: nowrap;
&:focus {
color: @icinga-blue;
outline-offset: -@vertical-padding / 2;
}
&:hover {
color: @icinga-blue;
text-decoration: none;
}
}
#menu .active > a {
color: @icinga-blue;
}
#menu .nav-level-1 > .nav-item {
line-height: 2.167em; // 26 px
&.active {
> a > .badge {
display: none;
}
.nav-level-2 > li {
// Expand menu if active
display: block;
}
background-color: @body-bg-color;
border-left: 5px solid @icinga-blue;
}
&.no-icon > a {
margin-left: @icon-width;
}
> a:active ~ .nav-level-2 > li {
display: block;
}
}
#menu .nav-level-2 > .nav-item {
// Collapse menu by default
display: none;
line-height: 1.833em; // 22px
margin-left: @icon-width;
> a {
font-size: @font-size-small;
}
}
.no-js #menu .nav-level-2 > .nav-item {
// Expand menu if JavaScript is disabled
display: block;
}
#menu img.icon {
line-height: 1;
margin: 0 0.2em;
width: 1em;
}
#menu .user-nav-item {
background-color: @gray;
color: @text-color-inverted;
> a:focus,
> a:hover {
background-color: @text-color-inverted;
color: @gray;
}
}
#menu input.search {
background: transparent url('../img/icons/search.png') no-repeat @horizontal-padding + 0.2em center;
background-size: 1em auto;
border: none;
line-height: 2.167em;
padding-left: @icon-width + @horizontal-padding;
width: 100%;
&.active {
background-color: @body-bg-color;
border-left: 5px solid @icinga-blue;
}
}
// Badge offset correction
#menu > nav > .nav-level-1 > .badge-nav-item > a > .badge {
margin-top: 0.5em;
}
#menu .nav-level-2 > .badge-nav-item > a > .badge {
margin-top: 0.5em;
}
// Hovered menu
#menu .nav-level-1 > .nav-item.hover {
position: relative;
&:before {
border: 0.5em solid rgba(0, 0, 0, 0);
border-right-color: @text-color;
content: "";
position: absolute;
right: 0;
top: 30%;
}
> .nav-level-2 {
background-color: @text-color;
color: @text-color-inverted;
left: 100%;
padding: @vertical-padding 0;
position: absolute;
top: 0;
> .nav-item {
display: block;
> a:hover {
color: @text-color-inverted;
text-decoration: underline;
}
}
}
> a > .badge {
display: none;
}
}
#layout.hoveredmenu {
#main {
z-index: 2;
}
#sidebar {
z-index: 3;
}
#menu {
overflow: visible;
}
}
// Accessibility skip links
.skip-links {
position: relative;
ul {
list-style-type: none;
margin: 0;
padding: 0;
li {
display: block;
a, button[type="submit"] {
background-color: @body-bg-color;
left: -999px;
padding: @vertical-padding @horizontal-padding;
position: absolute;
width: 100%;
&:focus {
left: 0;
outline: 1px dotted black;
}
}
button[type="submit"] {
text-align: left;
}
}
}
}