Last active
December 17, 2019 18:00
-
-
Save wesruv/36d8b9f8a2bff64f396a32ae17080a0b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// Visibility has to have a different delay on default state vs open state | |
/// Adding mixin so transitions are managed in one place instead of 2 | |
@mixin l-header__transitions($is-open: true) { | |
$visibility-delay: 0s; | |
@if $is-open { | |
visibility: visible; | |
} | |
@else { | |
visibility: hidden; | |
$visibility-delay: 0.3s; | |
} | |
// sass-lint:disable indentation | |
transition: | |
visibility 0s $visibility-delay, | |
transform 0.25s $cubic-bezier, | |
height 0.25s 0.125s $cubic-bezier; | |
// sass-lint:enable indentation | |
} | |
//sass-lint:disable no-mergeable-selectors | |
.l-header__outer-wrapper, | |
.l-header__primary-menu__outer-wrapper { | |
&, | |
.js-peek-a-boo-menu--scrolling-up &, | |
.js-show-aiche-menu[class] & { | |
@include l-header__transitions(); | |
height: vr(3); | |
transform: none; | |
@include breakpoint('nav-break') { | |
height: vr(4); | |
} | |
} | |
} | |
.l-header__secondary-menu__outer-wrapper, | |
.l-header__primary-menu__outer-wrapper { | |
.js-has-hide-aiche-menu-button.js-hide-aiche-menu &, | |
.js-peek-a-boo-menu--scrolling-down & { | |
@include l-header__transitions(false); | |
transform: translate(0, -150%); | |
height: 0; | |
overflow: hidden; | |
} | |
} | |
// Shouldn't move around secondary menu if there's a community menu | |
.l-header__secondary-menu__outer-wrapper { | |
.js-has-hide-aiche-menu-button.js-hide-aiche-menu.js-has-community-menu &, | |
.js-peek-a-boo-menu--scrolling-down.js-has-community-menu & { | |
transform: none; | |
} | |
} | |
// We need to see the secondary menu if there's a community menu | |
.l-header__secondary-menu__outer-wrapper { | |
.js-has-community-menu.js-has-hide-aiche-menu-button.js-hide-aiche-menu &, | |
.js-show-aiche-menu[class] & { | |
overflow: visible; | |
visibility: visible; | |
} | |
} | |
// If there's a community AND section menu and we're scrolling down we should hide the secondary menu | |
.l-header__secondary-menu__outer-wrapper { | |
.js-has-hide-aiche-menu-button.js-hide-aiche-menu.js-has-community-menu.js-has-section-menu.js-peek-a-boo-menu--scrolling-down & { | |
overflow: hidden; | |
visibility: hidden; | |
} | |
} | |
//sass-lint:enable no-mergeable-selectors | |
// The header wrapper needs to stay visible for the secondary menu | |
.l-header__outer-wrapper { //sass-lint:disable-line no-mergeable-selectors | |
transition: height 0.25s $cubic-bezier; | |
.js-has-hide-aiche-menu-button.js-hide-aiche-menu & { | |
height: 0; | |
visibility: visible; | |
overflow: visible; | |
} | |
.js-peek-a-boo-menu--scrolling-down & { | |
overflow: hidden; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment