Skip to content

Commit d56757f

Browse files
flourish86nilmerg
authored andcommitted
menu.less: Make caret appear connected to main viewport
1 parent 750948a commit d56757f

File tree

1 file changed

+10
-7
lines changed

1 file changed

+10
-7
lines changed

public/css/icinga/menu.less

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -123,13 +123,15 @@
123123
height: 1.25em;
124124
width: 1.25em;
125125
top: ~"calc(50% - (1.25em / 2))";
126+
z-index: 10;
126127
}
127128
}
128129

129130
#menu .nav-level-2 > .nav-item {
130131
// Collapse menu by default
131132
display: none;
132133
line-height: 1.833em; // 22px
134+
z-index: 12;
133135

134136
> a {
135137
color: @menu-2ndlvl-color;
@@ -267,31 +269,32 @@
267269
padding-bottom: @vertical-padding;
268270
width: 14em;
269271
position: fixed;
270-
z-index: 1;
272+
z-index: 11;
271273
margin-top: -1px; // Align content with the menu item, not its border
272274

273275
&::after {
276+
--caretSide: 1.25em;
277+
274278
.transform(rotate(45deg));
275279

276280
background-color: @body-bg-color;
277281
border-bottom: 1px solid @gray-light;
278282
border-left: 1px solid @gray-light;
279283
content: "";
280284
display: block;
281-
height: 1.1em;
282-
width: 1.1em;
285+
height: var(--caretSide);
286+
width: var(--caretSide);
283287
position: absolute;
284-
top: ~"calc((@{nav-item-height} / 2) - (1.1em / 2))";
285-
left: -.6em;
286-
z-index: -1;
288+
top: ~"calc(@{nav-item-height} / 2 - var(--caretSide) / 2)";
289+
left: ~"calc(-1 * var(--caretSide) / 2 - 1px)";
287290
}
288291

289292
&.bottom-up {
290293
--caretY: 100%;
291294
margin-top: 1px;
292295

293296
&::after {
294-
top: ~"calc(var(--caretY) - (@{nav-item-height} / 2) - (1.1em / 2))";
297+
top: ~"calc(var(--caretY) - (@{nav-item-height} / 2) - (var(--caretSide) / 2))";
295298
}
296299
}
297300

0 commit comments

Comments
 (0)