| 1 |
@import "../utilities/mixins" |
| 2 |
|
| 3 |
$navbar-background-color: $scheme-main !default |
| 4 |
$navbar-box-shadow-size: 0 2px 0 0 !default |
| 5 |
$navbar-box-shadow-color: $background !default |
| 6 |
$navbar-height: 3.25rem !default |
| 7 |
$navbar-padding-vertical: 1rem !default |
| 8 |
$navbar-padding-horizontal: 2rem !default |
| 9 |
$navbar-z: 30 !default |
| 10 |
$navbar-fixed-z: 30 !default |
| 11 |
|
| 12 |
$navbar-item-color: $text !default |
| 13 |
$navbar-item-hover-color: $link !default |
| 14 |
$navbar-item-hover-background-color: $scheme-main-bis !default |
| 15 |
$navbar-item-active-color: $scheme-invert !default |
| 16 |
$navbar-item-active-background-color: transparent !default |
| 17 |
$navbar-item-img-max-height: 1.75rem !default |
| 18 |
|
| 19 |
$navbar-burger-color: $navbar-item-color !default |
| 20 |
|
| 21 |
$navbar-tab-hover-background-color: transparent !default |
| 22 |
$navbar-tab-hover-border-bottom-color: $link !default |
| 23 |
$navbar-tab-active-color: $link !default |
| 24 |
$navbar-tab-active-background-color: transparent !default |
| 25 |
$navbar-tab-active-border-bottom-color: $link !default |
| 26 |
$navbar-tab-active-border-bottom-style: solid !default |
| 27 |
$navbar-tab-active-border-bottom-width: 3px !default |
| 28 |
|
| 29 |
$navbar-dropdown-background-color: $scheme-main !default |
| 30 |
$navbar-dropdown-border-top: 2px solid $border !default |
| 31 |
$navbar-dropdown-offset: -4px !default |
| 32 |
$navbar-dropdown-arrow: $link !default |
| 33 |
$navbar-dropdown-radius: $radius-large !default |
| 34 |
$navbar-dropdown-z: 20 !default |
| 35 |
|
| 36 |
$navbar-dropdown-boxed-radius: $radius-large !default |
| 37 |
$navbar-dropdown-boxed-shadow: 0 8px 8px bulmaRgba($scheme-invert, 0.1), 0 0 0 1px bulmaRgba($scheme-invert, 0.1) !default |
| 38 |
|
| 39 |
$navbar-dropdown-item-hover-color: $scheme-invert !default |
| 40 |
$navbar-dropdown-item-hover-background-color: $background !default |
| 41 |
$navbar-dropdown-item-active-color: $link !default |
| 42 |
$navbar-dropdown-item-active-background-color: $background !default |
| 43 |
|
| 44 |
$navbar-divider-background-color: $background !default |
| 45 |
$navbar-divider-height: 2px !default |
| 46 |
|
| 47 |
$navbar-bottom-box-shadow-size: 0 -2px 0 0 !default |
| 48 |
|
| 49 |
$navbar-breakpoint: $desktop !default |
| 50 |
|
| 51 |
$navbar-colors: $colors !default |
| 52 |
|
| 53 |
=navbar-fixed |
| 54 |
left: 0 |
| 55 |
position: fixed |
| 56 |
right: 0 |
| 57 |
z-index: $navbar-fixed-z |
| 58 |
|
| 59 |
.navbar |
| 60 |
background-color: $navbar-background-color |
| 61 |
min-height: $navbar-height |
| 62 |
position: relative |
| 63 |
z-index: $navbar-z |
| 64 |
@each $name, $pair in $navbar-colors |
| 65 |
$color: nth($pair, 1) |
| 66 |
$color-invert: nth($pair, 2) |
| 67 |
&.is-#{$name} |
| 68 |
background-color: $color |
| 69 |
color: $color-invert |
| 70 |
.navbar-brand |
| 71 |
& > .navbar-item, |
| 72 |
.navbar-link |
| 73 |
color: $color-invert |
| 74 |
& > a.navbar-item, |
| 75 |
.navbar-link |
| 76 |
&:focus, |
| 77 |
&:hover, |
| 78 |
&.is-active |
| 79 |
background-color: bulmaDarken($color, 5%) |
| 80 |
color: $color-invert |
| 81 |
.navbar-link |
| 82 |
&::after |
| 83 |
border-color: $color-invert |
| 84 |
.navbar-burger |
| 85 |
color: $color-invert |
| 86 |
+from($navbar-breakpoint) |
| 87 |
.navbar-start, |
| 88 |
.navbar-end |
| 89 |
& > .navbar-item, |
| 90 |
.navbar-link |
| 91 |
color: $color-invert |
| 92 |
& > a.navbar-item, |
| 93 |
.navbar-link |
| 94 |
&:focus, |
| 95 |
&:hover, |
| 96 |
&.is-active |
| 97 |
background-color: bulmaDarken($color, 5%) |
| 98 |
color: $color-invert |
| 99 |
.navbar-link |
| 100 |
&::after |
| 101 |
border-color: $color-invert |
| 102 |
.navbar-item.has-dropdown:focus .navbar-link, |
| 103 |
.navbar-item.has-dropdown:hover .navbar-link, |
| 104 |
.navbar-item.has-dropdown.is-active .navbar-link |
| 105 |
background-color: bulmaDarken($color, 5%) |
| 106 |
color: $color-invert |
| 107 |
.navbar-dropdown |
| 108 |
a.navbar-item |
| 109 |
&.is-active |
| 110 |
background-color: $color |
| 111 |
color: $color-invert |
| 112 |
& > .container |
| 113 |
align-items: stretch |
| 114 |
display: flex |
| 115 |
min-height: $navbar-height |
| 116 |
width: 100% |
| 117 |
&.has-shadow |
| 118 |
box-shadow: $navbar-box-shadow-size $navbar-box-shadow-color |
| 119 |
&.is-fixed-bottom, |
| 120 |
&.is-fixed-top |
| 121 |
+navbar-fixed |
| 122 |
&.is-fixed-bottom |
| 123 |
bottom: 0 |
| 124 |
&.has-shadow |
| 125 |
box-shadow: $navbar-bottom-box-shadow-size $navbar-box-shadow-color |
| 126 |
&.is-fixed-top |
| 127 |
top: 0 |
| 128 |
|
| 129 |
html, |
| 130 |
body |
| 131 |
&.has-navbar-fixed-top |
| 132 |
padding-top: $navbar-height |
| 133 |
&.has-navbar-fixed-bottom |
| 134 |
padding-bottom: $navbar-height |
| 135 |
|
| 136 |
.navbar-brand, |
| 137 |
.navbar-tabs |
| 138 |
align-items: stretch |
| 139 |
display: flex |
| 140 |
flex-shrink: 0 |
| 141 |
min-height: $navbar-height |
| 142 |
|
| 143 |
.navbar-brand |
| 144 |
a.navbar-item |
| 145 |
&:focus, |
| 146 |
&:hover |
| 147 |
background-color: transparent |
| 148 |
|
| 149 |
.navbar-tabs |
| 150 |
+overflow-touch |
| 151 |
max-width: 100vw |
| 152 |
overflow-x: auto |
| 153 |
overflow-y: hidden |
| 154 |
|
| 155 |
.navbar-burger |
| 156 |
@extend %reset |
| 157 |
color: $navbar-burger-color |
| 158 |
+hamburger($navbar-height) |
| 159 |
+ltr-property("margin", auto, false) |
| 160 |
|
| 161 |
.navbar-menu |
| 162 |
display: none |
| 163 |
|
| 164 |
.navbar-item, |
| 165 |
.navbar-link |
| 166 |
color: $navbar-item-color |
| 167 |
display: block |
| 168 |
line-height: 1.5 |
| 169 |
padding: 0.5rem 0.75rem |
| 170 |
position: relative |
| 171 |
.icon |
| 172 |
&:only-child |
| 173 |
margin-left: -0.25rem |
| 174 |
margin-right: -0.25rem |
| 175 |
|
| 176 |
a.navbar-item, |
| 177 |
.navbar-link |
| 178 |
cursor: pointer |
| 179 |
&:focus, |
| 180 |
&:focus-within, |
| 181 |
&:hover, |
| 182 |
&.is-active |
| 183 |
background-color: $navbar-item-hover-background-color |
| 184 |
color: $navbar-item-hover-color |
| 185 |
|
| 186 |
.navbar-item |
| 187 |
flex-grow: 0 |
| 188 |
flex-shrink: 0 |
| 189 |
img |
| 190 |
max-height: $navbar-item-img-max-height |
| 191 |
&.has-dropdown |
| 192 |
padding: 0 |
| 193 |
&.is-expanded |
| 194 |
flex-grow: 1 |
| 195 |
flex-shrink: 1 |
| 196 |
&.is-tab |
| 197 |
border-bottom: 1px solid transparent |
| 198 |
min-height: $navbar-height |
| 199 |
padding-bottom: calc(0.5rem - 1px) |
| 200 |
&:focus, |
| 201 |
&:hover |
| 202 |
background-color: $navbar-tab-hover-background-color |
| 203 |
border-bottom-color: $navbar-tab-hover-border-bottom-color |
| 204 |
&.is-active |
| 205 |
background-color: $navbar-tab-active-background-color |
| 206 |
border-bottom-color: $navbar-tab-active-border-bottom-color |
| 207 |
border-bottom-style: $navbar-tab-active-border-bottom-style |
| 208 |
border-bottom-width: $navbar-tab-active-border-bottom-width |
| 209 |
color: $navbar-tab-active-color |
| 210 |
padding-bottom: calc(0.5rem - #{$navbar-tab-active-border-bottom-width}) |
| 211 |
|
| 212 |
.navbar-content |
| 213 |
flex-grow: 1 |
| 214 |
flex-shrink: 1 |
| 215 |
|
| 216 |
.navbar-link:not(.is-arrowless) |
| 217 |
+ltr-property("padding", 2.5em) |
| 218 |
&::after |
| 219 |
@extend %arrow |
| 220 |
border-color: $navbar-dropdown-arrow |
| 221 |
margin-top: -0.375em |
| 222 |
+ltr-position(1.125em) |
| 223 |
|
| 224 |
.navbar-dropdown |
| 225 |
font-size: 0.875rem |
| 226 |
padding-bottom: 0.5rem |
| 227 |
padding-top: 0.5rem |
| 228 |
.navbar-item |
| 229 |
padding-left: 1.5rem |
| 230 |
padding-right: 1.5rem |
| 231 |
|
| 232 |
.navbar-divider |
| 233 |
background-color: $navbar-divider-background-color |
| 234 |
border: none |
| 235 |
display: none |
| 236 |
height: $navbar-divider-height |
| 237 |
margin: 0.5rem 0 |
| 238 |
|
| 239 |
+until($navbar-breakpoint) |
| 240 |
.navbar > .container |
| 241 |
display: block |
| 242 |
.navbar-brand, |
| 243 |
.navbar-tabs |
| 244 |
.navbar-item |
| 245 |
align-items: center |
| 246 |
display: flex |
| 247 |
.navbar-link |
| 248 |
&::after |
| 249 |
display: none |
| 250 |
.navbar-menu |
| 251 |
background-color: $navbar-background-color |
| 252 |
box-shadow: 0 8px 16px bulmaRgba($scheme-invert, 0.1) |
| 253 |
padding: 0.5rem 0 |
| 254 |
&.is-active |
| 255 |
display: block |
| 256 |
// Fixed navbar |
| 257 |
.navbar |
| 258 |
&.is-fixed-bottom-touch, |
| 259 |
&.is-fixed-top-touch |
| 260 |
+navbar-fixed |
| 261 |
&.is-fixed-bottom-touch |
| 262 |
bottom: 0 |
| 263 |
&.has-shadow |
| 264 |
box-shadow: 0 -2px 3px bulmaRgba($scheme-invert, 0.1) |
| 265 |
&.is-fixed-top-touch |
| 266 |
top: 0 |
| 267 |
&.is-fixed-top, |
| 268 |
&.is-fixed-top-touch |
| 269 |
.navbar-menu |
| 270 |
+overflow-touch |
| 271 |
max-height: calc(100vh - #{$navbar-height}) |
| 272 |
overflow: auto |
| 273 |
html, |
| 274 |
body |
| 275 |
&.has-navbar-fixed-top-touch |
| 276 |
padding-top: $navbar-height |
| 277 |
&.has-navbar-fixed-bottom-touch |
| 278 |
padding-bottom: $navbar-height |
| 279 |
|
| 280 |
+from($navbar-breakpoint) |
| 281 |
.navbar, |
| 282 |
.navbar-menu, |
| 283 |
.navbar-start, |
| 284 |
.navbar-end |
| 285 |
align-items: stretch |
| 286 |
display: flex |
| 287 |
.navbar |
| 288 |
min-height: $navbar-height |
| 289 |
&.is-spaced |
| 290 |
padding: $navbar-padding-vertical $navbar-padding-horizontal |
| 291 |
.navbar-start, |
| 292 |
.navbar-end |
| 293 |
align-items: center |
| 294 |
a.navbar-item, |
| 295 |
.navbar-link |
| 296 |
border-radius: $radius |
| 297 |
&.is-transparent |
| 298 |
a.navbar-item, |
| 299 |
.navbar-link |
| 300 |
&:focus, |
| 301 |
&:hover, |
| 302 |
&.is-active |
| 303 |
background-color: transparent !important |
| 304 |
.navbar-item.has-dropdown |
| 305 |
&.is-active, |
| 306 |
&.is-hoverable:focus, |
| 307 |
&.is-hoverable:focus-within, |
| 308 |
&.is-hoverable:hover |
| 309 |
.navbar-link |
| 310 |
background-color: transparent !important |
| 311 |
.navbar-dropdown |
| 312 |
a.navbar-item |
| 313 |
&:focus, |
| 314 |
&:hover |
| 315 |
background-color: $navbar-dropdown-item-hover-background-color |
| 316 |
color: $navbar-dropdown-item-hover-color |
| 317 |
&.is-active |
| 318 |
background-color: $navbar-dropdown-item-active-background-color |
| 319 |
color: $navbar-dropdown-item-active-color |
| 320 |
.navbar-burger |
| 321 |
display: none |
| 322 |
.navbar-item, |
| 323 |
.navbar-link |
| 324 |
align-items: center |
| 325 |
display: flex |
| 326 |
.navbar-item |
| 327 |
&.has-dropdown |
| 328 |
align-items: stretch |
| 329 |
&.has-dropdown-up |
| 330 |
.navbar-link::after |
| 331 |
transform: rotate(135deg) translate(0.25em, -0.25em) |
| 332 |
.navbar-dropdown |
| 333 |
border-bottom: $navbar-dropdown-border-top |
| 334 |
border-radius: $navbar-dropdown-radius $navbar-dropdown-radius 0 0 |
| 335 |
border-top: none |
| 336 |
bottom: 100% |
| 337 |
box-shadow: 0 -8px 8px bulmaRgba($scheme-invert, 0.1) |
| 338 |
top: auto |
| 339 |
&.is-active, |
| 340 |
&.is-hoverable:focus, |
| 341 |
&.is-hoverable:focus-within, |
| 342 |
&.is-hoverable:hover |
| 343 |
.navbar-dropdown |
| 344 |
display: block |
| 345 |
.navbar.is-spaced &, |
| 346 |
&.is-boxed |
| 347 |
opacity: 1 |
| 348 |
pointer-events: auto |
| 349 |
transform: translateY(0) |
| 350 |
.navbar-menu |
| 351 |
flex-grow: 1 |
| 352 |
flex-shrink: 0 |
| 353 |
.navbar-start |
| 354 |
justify-content: flex-start |
| 355 |
+ltr-property("margin", auto) |
| 356 |
.navbar-end |
| 357 |
justify-content: flex-end |
| 358 |
+ltr-property("margin", auto, false) |
| 359 |
.navbar-dropdown |
| 360 |
background-color: $navbar-dropdown-background-color |
| 361 |
border-bottom-left-radius: $navbar-dropdown-radius |
| 362 |
border-bottom-right-radius: $navbar-dropdown-radius |
| 363 |
border-top: $navbar-dropdown-border-top |
| 364 |
box-shadow: 0 8px 8px bulmaRgba($scheme-invert, 0.1) |
| 365 |
display: none |
| 366 |
font-size: 0.875rem |
| 367 |
+ltr-position(0, false) |
| 368 |
min-width: 100% |
| 369 |
position: absolute |
| 370 |
top: 100% |
| 371 |
z-index: $navbar-dropdown-z |
| 372 |
.navbar-item |
| 373 |
padding: 0.375rem 1rem |
| 374 |
white-space: nowrap |
| 375 |
a.navbar-item |
| 376 |
+ltr-property("padding", 3rem) |
| 377 |
&:focus, |
| 378 |
&:hover |
| 379 |
background-color: $navbar-dropdown-item-hover-background-color |
| 380 |
color: $navbar-dropdown-item-hover-color |
| 381 |
&.is-active |
| 382 |
background-color: $navbar-dropdown-item-active-background-color |
| 383 |
color: $navbar-dropdown-item-active-color |
| 384 |
.navbar.is-spaced &, |
| 385 |
&.is-boxed |
| 386 |
border-radius: $navbar-dropdown-boxed-radius |
| 387 |
border-top: none |
| 388 |
box-shadow: $navbar-dropdown-boxed-shadow |
| 389 |
display: block |
| 390 |
opacity: 0 |
| 391 |
pointer-events: none |
| 392 |
top: calc(100% + (#{$navbar-dropdown-offset})) |
| 393 |
transform: translateY(-5px) |
| 394 |
transition-duration: $speed |
| 395 |
transition-property: opacity, transform |
| 396 |
&.is-right |
| 397 |
left: auto |
| 398 |
right: 0 |
| 399 |
.navbar-divider |
| 400 |
display: block |
| 401 |
.navbar > .container, |
| 402 |
.container > .navbar |
| 403 |
.navbar-brand |
| 404 |
+ltr-property("margin", -.75rem, false) |
| 405 |
.navbar-menu |
| 406 |
+ltr-property("margin", -.75rem) |
| 407 |
// Fixed navbar |
| 408 |
.navbar |
| 409 |
&.is-fixed-bottom-desktop, |
| 410 |
&.is-fixed-top-desktop |
| 411 |
+navbar-fixed |
| 412 |
&.is-fixed-bottom-desktop |
| 413 |
bottom: 0 |
| 414 |
&.has-shadow |
| 415 |
box-shadow: 0 -2px 3px bulmaRgba($scheme-invert, 0.1) |
| 416 |
&.is-fixed-top-desktop |
| 417 |
top: 0 |
| 418 |
html, |
| 419 |
body |
| 420 |
&.has-navbar-fixed-top-desktop |
| 421 |
padding-top: $navbar-height |
| 422 |
&.has-navbar-fixed-bottom-desktop |
| 423 |
padding-bottom: $navbar-height |
| 424 |
&.has-spaced-navbar-fixed-top |
| 425 |
padding-top: $navbar-height + ($navbar-padding-vertical * 2) |
| 426 |
&.has-spaced-navbar-fixed-bottom |
| 427 |
padding-bottom: $navbar-height + ($navbar-padding-vertical * 2) |
| 428 |
// Hover/Active states |
| 429 |
a.navbar-item, |
| 430 |
.navbar-link |
| 431 |
&.is-active |
| 432 |
color: $navbar-item-active-color |
| 433 |
&.is-active:not(:focus):not(:hover) |
| 434 |
background-color: $navbar-item-active-background-color |
| 435 |
.navbar-item.has-dropdown |
| 436 |
&:focus, |
| 437 |
&:hover, |
| 438 |
&.is-active |
| 439 |
.navbar-link |
| 440 |
background-color: $navbar-item-hover-background-color |
| 441 |
|
| 442 |
// Combination |
| 443 |
|
| 444 |
.hero |
| 445 |
&.is-fullheight-with-navbar |
| 446 |
min-height: calc(100vh - #{$navbar-height}) |