barebones/assets/styles/components/_nav.scss

108 lines
2.1 KiB
SCSS
Raw Normal View History

2019-01-08 11:52:31 +01:00
/**
* Hamburger menu
*/
.nav-burger {
2019-01-08 11:52:31 +01:00
position: fixed;
top: $base-spacing-unit;
right: $base-spacing-unit;
z-index: 550;
transition: all $animation-speed $animation;
}
.nav-burger__line {
2019-01-08 11:52:31 +01:00
width: 35px;
height: 3px;
background-color: $brand-colour;
display: none;
margin: 8px auto;
transition: all $animation-speed $animation;
2019-01-08 11:52:31 +01:00
@include resp-max($breakpoint-md) {
display: block;
}
2019-01-08 11:52:31 +01:00
.nav-burger.open & {
&:nth-child(2) {
opacity: 0;
}
&:nth-child(1) {
transform: translateY(11px) rotate(45deg);
}
&:nth-child(3) {
transform: translateY(-11px) rotate(-45deg);
}
}
}
2019-01-08 11:52:31 +01:00
/**
* Navs
*/
2014-01-30 12:20:51 +01:00
.nav {
2017-12-15 13:51:21 +01:00
list-style: none;
margin: 0;
2017-12-15 13:51:21 +01:00
> li {
2019-01-08 11:52:31 +01:00
display: inline-block;
margin-right: $base-spacing-unit;
&:last-child {
margin-right: 0;
}
> a {
display: block;
}
}
}
.nav--header {
2019-01-08 11:52:31 +01:00
// mobile nav
@include resp-max($breakpoint-md) {
position: fixed;
top: 0;
left: 0;
2019-01-08 11:52:31 +01:00
visibility: hidden;
width: 0;
height: 100%;
margin: 0;
2019-01-08 11:52:31 +01:00
transition: opacity 500ms ease;
transition: opacity .35s ease, visibility .35s ease, width .35s ease;
text-align: center;
opacity: 0;
background: $base-background-colour;
-webkit-overflow-scrolling: touch;
2019-01-08 11:52:31 +01:00
&.open {
z-index: 500;
visibility: visible;
width: 100%;
opacity: 1;
ul {
position: absolute;
top: 50%;
left: 0;
overflow: auto;
width: 100%;
max-height: 100%;
margin: 0;
padding: 0;
user-select: none;
transform: translateY(-50%);
-webkit-touch-callout: none;
-webkit-overflow-scrolling: touch;
> li {
width: 100%;
margin: 0;
}
}
2015-10-15 18:24:32 +02:00
}
2014-02-03 16:33:44 +01:00
}
}