/
_nav.scss
182 lines (157 loc) · 3.84 KB
/
_nav.scss
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
/*************************************************
* Navigation bar
**************************************************/
.navbar {
height: 70px;
background: $sta-menu-primary;
box-shadow: 0 0.125rem 0.25rem 0 rgba(0,0,0,.11);
font-size: #{$sta-font-size-small}px;
position: fixed;
top: 0;
right: 0;
left: 0;
z-index: 1030;
@include media-breakpoint-down(md) {
height: 50px;
.navbar-nav-scroll {
width: 100%;
overflow: hidden;
.navbar-nav {
overflow-x: auto;
white-space: nowrap;
-webkit-overflow-scrolling: touch;
}
}
}
.navbar-nav {
display: flex;
.nav-link {
color: rgba($sta-menu-text, .85);
&.active,
&:hover,
&:focus {
color: $sta-menu-text;
}
&.active {
font-weight: bold !important;
color: $sta-menu-text-active !important;
}
}
}
.dropdown-menu {
font-size: #{$sta-font-size-small}px;
}
// Note: dedicated `i18n-active` class to prevent ScrollSpy removing `active` class from language chooser.
.dropdown-item.active,
.i18n-active {
font-weight: bold;
color: $sta-menu-text-active !important;
}
}
.dark .navbar {
box-shadow: 0 0.125rem 0.25rem 0 rgba(255, 255, 255, .11);
}
// Remove Bootstrap's border from Toggle button.
.navbar-toggler {
border: 0 !important;
}
.navbar-toggler:focus,
.navbar-toggler:active {
outline: none !important;
box-shadow: none !important;
}
@include media-breakpoint-down(md) { /* Match breakpoint for i18n dropdown in navbar.html. */
.i18n-dropdown .nav-link::after {
content: none;
}
.i18n-dropdown .dropdown-menu {
/* Use style from uncollapsable dropdowns to prevent dropdown going off page. */
position: absolute;
/* Below style from .dropdown-menu-right to prevent dropdown going off page. */
right: 0;
left: auto;
}
}
// Allow user to horizontally scroll.
// Commented out this feature as it causes dropdowns to appear within the menu bar.
// TODO: re-enable in a way that doesn't break dropdowns.
/*
.navbar .collapse {
overflow-x: auto;
}
*/
.navbar-brand {
padding-top: 0;
padding-bottom: 0;
font-weight: bold;
}
// Dynamically fit logo image to space available.
// No need to explicitly set a size for each breakpoint.
// See https://caniuse.com/#feat=mdn-css_properties_width_stretch .
.navbar-brand img {
width: auto;
height: -moz-available;
height: -webkit-fill-available;
height: -webkit-stretch;
height: stretch;
max-width: fit-content; // Must override default responsive image style.
}
#navbar-main .main-menu-item ul li .nav-link {
color: $sta-menu-text;
}
@include media-breakpoint-down(md) {
.navbar-brand {
max-width: fit-content;
margin: 0 auto;
position: absolute;
left: 0;
right: 0;
display: inline-block;
}
.navbar-toggler {
border-color: transparent; // Remove Bootstrap's border from Toggle button.
}
#navbar-main .main-menu-item {
text-align: left !important;
padding-left: 0;
}
.navbar-collapse {
z-index: 9999 !important;
position: absolute;
left: 0;
top: 50px;
width: 100%;
background-color: $sta-menu-primary;
text-align: center !important;
}
#navbar-main .main-menu-item .nav-item {
padding: 10px 15px !important;
}
#navbar-main .main-menu-item .nav-item .nav-link {
padding: 5px 15px !important;
}
}
ul.nav-icons {
list-style-type: none;
font-size: 18px;
padding: 0.5rem 0 0.5rem 0;
margin: 0;
}
ul.nav-icons li {
display: inline;
padding-right: 1rem;
}
ul.nav-icons li:last-of-type {
padding-right: 0;
}
ul.nav-icons li.nav-item a.nav-link {
padding: 0;
}
.dropdown-menu {
background-color: $sta-menu-primary !important;
color: $sta-menu-text !important;
}
.dropdown-item {
background-color: $sta-menu-primary !important;
color: $sta-menu-text !important;
}