/
nav.less
128 lines (104 loc) · 2.25 KB
/
nav.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
// Add top padding equal to the height of the navigation bar
// --------------------------------------------------
html.is-nav-top #wrapper {
padding-top: var(--adapt-navigation-height);
}
html.is-nav-bottom #wrapper {
padding-bottom: var(--adapt-navigation-height);
}
.nav {
position: fixed;
width: 100%;
z-index: 80;
html.is-nav-top & {
top: 0;
}
html.is-nav-bottom & {
bottom: 0;
}
&__inner {
.l-container-responsive(@max-page-width);
display: flex;
align-items: stretch;
}
&__btn {
display: inline-flex;
align-items: center;
justify-content: center;
// Override floats on additional `nav__btn` elements part of plugins
// that haven't been updated to work with data-order yet.
// Can be removed in time.
float: none !important;
}
&.hide-label &__btn-label,
&__btn.hide-label &__btn-label {
display: none;
}
&.show-label {
.show-nav-label(small);
.show-nav-label(medium);
.show-nav-label(large);
}
&.has-label-right &__btn-label {
margin-inline-start: @icon-padding / 2;
}
&.has-label-bottom {
.nav__btn {
flex-direction: column;
}
.nav__btn-label {
margin-top: @icon-padding / 2;
}
}
&.has-label-top {
.nav__btn {
flex-direction: column;
}
.nav__btn-label {
order: -1;
margin-bottom: @icon-padding / 2;
}
}
.has-label-left &__btn-label {
order: -1;
}
&.has-label-left .icon ~ .nav__btn-label {
margin-inline-end: @icon-padding / 2;
}
&.has-label-auto .icon ~ .nav__btn-label {
margin-inline-start: @icon-padding / 2;
}
&__spacer {
flex-grow: 1;
}
&__skip-btn {
position: absolute;
left: 0;
top: 0;
z-index: 100;
html:not(.has-accessibility) & {
.u-display-none;
}
&:not(:focus-visible) {
height: 0;
padding: 0;
margin: 0;
overflow: hidden;
}
}
&__back-btn .icon {
.icon-controls-small-left;
}
}
// Show nav label at breakpoints
.show-nav-label(@size) {
&.show-label-@{size} {
.nav__btn-label { display: none }
.nav__btn:not(.hide-label) .nav__btn-label {
@breakpoint: "device-width-@{size}";
@media (min-width: @@breakpoint) {
display: initial;
}
}
}
}