Skip to content

Commit 108492d

Browse files
fix: Fix menu navigation with long labels
1 parent 8a8f029 commit 108492d

2 files changed

Lines changed: 32 additions & 29 deletions

File tree

src/assets/stylesheets/layouts/sidenav.css

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,6 @@
2020
z-index: 50;
2121

2222
visibility: hidden;
23-
24-
transition: visibility 0s linear 0.2s;
2523
}
2624

2725
.sidenav__container::before {
@@ -34,24 +32,23 @@
3432

3533
opacity: 0;
3634
background-color: var(--color-box-shadow);
37-
38-
transition: opacity 0.2s ease-in-out;
3935
}
4036

4137
.sidenav__container .sidenav__menu {
42-
overflow: hidden;
38+
overflow: hidden auto;
4339

4440
width: 0;
45-
max-width: 90%;
41+
max-width: 90vw;
4642
height: 100%;
47-
padding: var(--space-small);
48-
49-
white-space: nowrap;
5043

5144
background-color: var(--color-background);
5245
box-shadow: 0 0 10px rgb(0 0 0 / 50%);
46+
}
5347

54-
transition: width 0.2s ease-in-out;
48+
.sidenav__container .sidenav__inner {
49+
width: var(--sidenav-width);
50+
max-width: 90vw;
51+
padding: var(--space-small);
5552
}
5653

5754
.sidenav__close-button {
@@ -60,16 +57,18 @@
6057

6158
.sidenav__open-button[aria-expanded="true"] + .sidenav__container {
6259
visibility: visible;
63-
64-
transition: visibility 0s linear 0s;
6560
}
6661

6762
.sidenav__open-button[aria-expanded="true"] + .sidenav__container::before {
6863
opacity: 1;
64+
65+
transition: opacity 0.2s ease-in-out;
6966
}
7067

7168
.sidenav__open-button[aria-expanded="true"] + .sidenav__container .sidenav__menu {
7269
width: var(--sidenav-width);
70+
71+
transition: width 0.2s ease-in-out;
7372
}
7473
}
7574

@@ -81,6 +80,8 @@
8180
}
8281

8382
.sidenav__menu-item {
83+
overflow-wrap: anywhere;
84+
8485
display: block;
8586
width: 100%;
8687
padding: var(--space-small);

src/views/layouts/_sidenav.html.twig

Lines changed: 19 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -11,24 +11,26 @@
1111
</button>
1212

1313
<div class="sidenav__container" data-action="click->sidenav#closeOnMask">
14-
<nav class="sidenav__menu flow flow--smaller">
15-
<div class="text--right">
16-
<button
17-
type="button"
18-
class="sidenav__close-button button--icon"
19-
data-action="sidenav#close"
20-
data-sidenav-target="closer"
21-
>
22-
{{ icon('times') }}
23-
<span class="sr-only">
24-
{{ t('Close') }}
25-
</span>
26-
</button>
27-
</div>
14+
<nav class="sidenav__menu">
15+
<div class="sidenav__inner flow flow--smaller">
16+
<div class="text--right">
17+
<button
18+
type="button"
19+
class="sidenav__close-button button--icon"
20+
data-action="sidenav#close"
21+
data-sidenav-target="closer"
22+
>
23+
{{ icon('times') }}
24+
<span class="sr-only">
25+
{{ t('Close') }}
26+
</span>
27+
</button>
28+
</div>
2829

29-
{% for element in navigation.elements %}
30-
{{ include('layouts/_sidenav_element.html.twig') }}
31-
{% endfor %}
30+
{% for element in navigation.elements %}
31+
{{ include('layouts/_sidenav_element.html.twig') }}
32+
{% endfor %}
33+
</div>
3234
</nav>
3335
</div>
3436
</div>

0 commit comments

Comments
 (0)