Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DP-19337 Open/close behaviors in the hamburger menu #1131

Merged
Show file tree
Hide file tree
Changes from 104 commits
Commits
Show all changes
109 commits
Select commit Hold shift + click to select a range
8734dfd
test edit
ygannett Jun 22, 2020
02b838d
fix the dropdown visibility to keybord and screen readers maintaiing …
ygannett Jun 23, 2020
2507f0a
fix the dropdown visibility to keybord and screen readers maintaiing …
ygannett Jun 23, 2020
0730bb2
comment out the condition causing the keyboard trap issue with the me…
ygannett Jun 23, 2020
8d9572f
correct aria-hidden placement for the dropdown
ygannett Jun 23, 2020
5a6826d
add jumpToSearch functioin
ygannett Jun 23, 2020
0d0f807
disable mainNavMixed.js to avoid override mainNavHamburger.js
ygannett Jun 23, 2020
bda9cc5
menu button label edit
ygannett Jun 24, 2020
6ec0695
add chevron to direct link in main nav top level
ygannett Jun 24, 2020
3d98228
correct aria-hidden for + icon container
ygannett Jun 24, 2020
ab49672
clean up menu button label variables
ygannett Jun 24, 2020
a48cecc
adjust icons for link and button in hamburger menu
ygannett Jun 24, 2020
4057fe4
separate hamburger utility nav style from utility-nav.scss
ygannett Jun 24, 2020
48b1002
match utility nav in hamburger menu to main nav style
ygannett Jun 25, 2020
5033587
add open/close behavior to util nav in hamburger menu
ygannett Jun 25, 2020
24dae23
separate hamburger nav utlity nav style separate from utility-nav.scss
ygannett Jun 25, 2020
4453653
resolve merge conflicts.
ygannett Jun 25, 2020
f43df8d
reverting merge conflict fix 1
ygannett Jun 25, 2020
1db8f8f
reverting merge conflict fix 2
ygannett Jun 25, 2020
34aa491
fix search access icon in page view
ygannett Jun 25, 2020
bf18c97
Merge branch 'patternlab/DP-17154_header-change-with-new-global-nav_m…
ygannett Jun 25, 2020
c1f968a
fix lint errors
ygannett Jun 25, 2020
8f511ea
Merge branch 'patternlab/DP-17200-add-horizontal-nav-code-branch' int…
ygannett Jun 25, 2020
fb12fdb
lint error fix
ygannett Jun 26, 2020
dda53a5
fix the hidden utility content height
ygannett Jun 26, 2020
009f3f8
correct target container for utility content
ygannett Jun 26, 2020
3f03b73
adjust vertical positioning of the menu button text
ygannett Jun 26, 2020
c5bce21
move back original styles belong to utility_nav.scss
ygannett Jun 26, 2020
76bbff6
correct class in utility item
ygannett Jun 28, 2020
ac5a091
set up open/close behaviors for wide/util nav bar 'log in to'
ygannett Jun 28, 2020
1d856ab
set up open/close behaviors for narrow/hamburger menu 'log in to
ygannett Jun 29, 2020
b3304ff
fix conflict between 'log in to' buttons
ygannett Jun 29, 2020
20395e6
uncomment test style
ygannett Jun 29, 2020
c7db7fb
set focus between menu button, hamburger menu container, jump to sear…
ygannett Jun 29, 2020
1f6f52d
Merge branch 'patternlab/DP-17200-add-horizontal-nav-code-branch' int…
ygannett Jun 29, 2020
29ffbc8
test edit
ygannett Jun 29, 2020
b5792f3
Merge branch 'patternlab/DP-17154_header-change-with-new-global-nav' …
ygannett Jun 29, 2020
63d0c12
fix syntax error
ygannett Jun 29, 2020
763c7a6
merge hamburger and mix template and scss to minimize duplicate.
ygannett Jun 29, 2020
46ca761
clean up duplicate
ygannett Jun 30, 2020
4a786f6
merge mainNavMixed.js to mainNavHamburger.js
ygannett Jun 30, 2020
83edf74
fix width for log in to content
ygannett Jun 30, 2020
4f657bb
fix lint errors
ygannett Jun 30, 2020
b919910
lint error fix
ygannett Jun 30, 2020
eeacf43
fix positioning of the hamburger menu container
ygannett Jun 30, 2020
bd21ffb
smooth open/close behavior of log in to content in wide version
ygannett Jun 30, 2020
cc7d506
adjust open/close behavior of log in to content in wide version
ygannett Jun 30, 2020
fb4a547
remove invalid attribute
ygannett Jun 30, 2020
101466b
remove duplicate markup
ygannett Jun 30, 2020
686ef0b
style log in to content in hamburger nav
ygannett Jun 30, 2020
ef8964d
fix error
ygannett Jul 1, 2020
cc565c4
fix errors
ygannett Jul 1, 2020
8c4885a
fix error
ygannett Jul 1, 2020
f007638
test edit
ygannett Jul 1, 2020
230aef7
fix some lint errors in the existing code
ygannett Jul 1, 2020
94e06c0
remove test style
ygannett Jul 1, 2020
d0d452e
resolve conflicts between utilNav.js and mainNavHamburger.js
ygannett Jul 1, 2020
e1b0177
remove duplicate markup
ygannett Jul 1, 2020
d2187ea
fix conflicts between 2 utlity content displays
ygannett Jul 1, 2020
ed832d4
set container size for utility container in hamburger menu on load
ygannett Jul 1, 2020
ef932dd
hide utility nav content when sub menu in main nav is open
ygannett Jul 1, 2020
59b6c25
remove unnecessary aria-label from hamburger main nav
ygannett Jul 1, 2020
bafde18
hide hamburger menu at resizing window in mix
ygannett Jul 1, 2020
483a2f8
Hide hamburger menu when window size is resized to over 840 while ham…
ygannett Jul 1, 2020
0a8ec2a
adjustment for Drupal output
ygannett Jul 2, 2020
08f112d
test edit
ygannett Jul 2, 2020
bbe45a9
add changelog for DP-17154
ygannett Jul 2, 2020
8ded5f6
remove box-shadow from utility nav item in hamburger menu
ygannett Jul 2, 2020
eb6c257
setting up to close sub mneu as opening the utility nav content
ygannett Jul 7, 2020
a10dccc
set up focus on the search box in the hamburger menu by clicking the …
ygannett Jul 8, 2020
baf1fe3
clean up unnecessary tabindex and aria-label
ygannett Jul 8, 2020
13e9e20
fix typo
ygannett Jul 9, 2020
115ef11
setting up closure with esc key
ygannett Jul 9, 2020
5808c5e
adjust focsus issue as menu open/close
ygannett Jul 9, 2020
9ed7041
fix tabindex at closing menu button
ygannett Jul 9, 2020
662fc28
add bottom border to 'log in to...' content box
ygannett Jul 13, 2020
6583128
remove unnecessary line
ygannett Jul 14, 2020
2718095
test edit
ygannett Jul 15, 2020
f995591
animation fix with util nav content
ygannett Jul 17, 2020
870d3fe
separate utility nav in hamburger nav from utilNav.js
ygannett Jul 17, 2020
9e2c5f5
remove unnecessary lines for open/close util. content function copied…
ygannett Jul 17, 2020
83ee8a1
add closeSubmenu at opening util content
ygannett Jul 17, 2020
01f336b
modify susubmenu closing animation at opening util. nav content
ygannett Jul 17, 2020
7f49639
add a condition to che ck if any open submenu to closeSubmenu()
ygannett Jul 17, 2020
c84528d
test edit
ygannett Jul 21, 2020
5bfc979
slow down closing submenu speed
ygannett Jul 21, 2020
330b49d
clean up comments
ygannett Jul 21, 2020
b14ed3f
add changelog for DP-19337
ygannett Jul 21, 2020
f27eceb
fix lint error
ygannett Jul 21, 2020
78d2dd6
Resolve conflict.
ygannett Jul 22, 2020
073c6a9
put back nav bar padding change in DP-19335
ygannett Jul 21, 2020
7307db1
clean up comments
ygannett Jul 22, 2020
1992b6c
menu botton positioning
ygannett Jul 22, 2020
b9a067a
fix format
ygannett Jul 22, 2020
5c5f215
fix menu button label which is not working in patternlab/DP-17200-add…
ygannett Jul 22, 2020
5c7410b
resolve merge conflicts
ygannett Jul 22, 2020
041f140
expand close button to fill the blue bar
ygannett Jul 22, 2020
ee2c967
Merge branch 'patternlab/DP-17200-add-horizontal-nav-code-branch' int…
ygannett Jul 22, 2020
9089750
fix lint error
ygannett Jul 22, 2020
3191f8a
Merge branch 'patternlab/DP-19337_log-in-to-component' of github.com:…
ygannett Jul 22, 2020
d584516
fix lint error
ygannett Jul 22, 2020
5e7f382
slow the log-in-to content open/close animation
ygannett Jul 27, 2020
5b72213
clean up comments
ygannett Aug 3, 2020
78e723a
Merge branch 'patternlab/DP-17200-add-horizontal-nav-code-branch' int…
ygannett Aug 3, 2020
5e8bb71
Merged in DP-17200, resolved merge conflicts - DP-19337
tom-fleming Aug 6, 2020
f9a04c4
fix typo
ygannett Aug 7, 2020
431ccb7
Resolve merge conflicts.
ygannett Aug 10, 2020
ff05f4c
fix lint errors
ygannett Aug 10, 2020
b4245f0
fix rendering issues causing backstop errors
ygannett Aug 10, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
196 changes: 105 additions & 91 deletions assets/scss/03-organisms/_header-hamburger.scss
Original file line number Diff line number Diff line change
Expand Up @@ -360,19 +360,23 @@ body.show-menu {
position: relative;
display: inline-block;
padding-left: 25px;
}

&__desktop-label {
&::before {

@media ($bp-small-max) {
display: none;
}
}
@media ($bp-small-max) {

&__mobile-label {
content: "Mass.gov";
}

@media ($bp-small-min) {

content: "Menu";
}

@media ($bp-small-min) {
display: none;
}

.show-menu &:before {
content: "Close";
}
}

Expand All @@ -397,7 +401,6 @@ body.show-menu {
}
}


&__nav-search {
padding: 15px 20px 15px;

Expand Down Expand Up @@ -534,111 +537,122 @@ body.show-menu {
border-bottom-color: $c-primary-alt;
}
}
}
}

// Override styles for desktop version utility nav content.
.show-menu &__content {

.show-menu & .ma__utility-nav__content {
// Override styles for desktop version utility nav content.
margin: 0;
padding: 0;
width: 100%;
position: relative;
top: auto;
right: auto;
color: $c-black;
z-index: 90;

@media ($bp-header-toggle-max) {
transition: max-height 0.6s ease-in-out;

position: relative;
top: auto;
right: auto;
margin: 0;
padding: 0;
width: 100%;
color: $c-black;
&.is-closed {

height: 0;
opacity: 0;
@include ma-visually-hidden;

transition: opacity 0.2s;
transition: height 0.6s;
overflow-y: hidden;
padding: 0;
margin: 0;

.is-closed & {
transition: opacity 0.2s;
}
display: none !important;
transition: max-height 0.8s ease-in-out;
}

& .ma__utility-nav__content-title {
display: none;
}
& .ma__utility-nav__content-title {
display: none;
}

& .ma__utility-nav__container {
padding: 0;
background-color: $c-gray-lightest;
overflow-y: visible;
& .ma__utility-nav__container {
padding: 0;
background-color: $c-gray-lightest;
overflow-y: visible;
max-height: auto;

transition: opacity 0.4s;

.translated-rtl &,
.translated-ltr & {
height: auto;
.translated-rtl &,
.translated-ltr & {
height: auto;
}
}
}

& .ma__utility-nav__container__close {// close window button in the dropdown.
display: none;
}
&.is-closed .ma__utility-nav__container {
transition: opacity 0.2s;
}

& .ma__utility-panel {
background-color: $c-gray-lightest;
color: $c-black;
// Override styles for desktop version utility nav content.

@include ma-reset-list;
}
& .ma__utility-nav__container__close {// close window button in the dropdown.

& .ma__utility-panel + .ma__utility-panel {
margin-top: 1em;
}

& .ma__utility-panel__description {
width: 100%;
text-align: left;
display: block;
position: relative;
font-style: italic;
font-size: 1.125rem;
line-height: 1.33;
padding: 10px 20px 10px 30px;
color: $c-black;
margin-bottom: 0;
}
display: none;
}

& .ma__utility-panel__items {
margin-bottom: 0;
}
& .ma__utility-panel {
background-color: $c-gray-lightest;
color: $c-black;

& .ma__utility-panel__item {
background-color: $c-gray-lightest;
color: $c-black;
margin: 0;
display: block;
}
@include ma-reset-list;
}

& .ma__utility-panel__item .ma__decorative-link {
padding: 0;
}
& .ma__utility-panel + .ma__utility-panel {
margin-top: 1em;
}

& .ma__utility-panel__item .ma__decorative-link a {
& .ma__utility-panel__description {
width: 100%;
text-align: left;
display: block;
position: relative;
font-style: italic;
font-size: 1.125rem;
line-height: 1.33;
padding: 10px 20px 10px 30px;
color: $c-black;
margin-bottom: 0;
}

@include ma-button-reset;
& .ma__utility-panel__items {
margin-bottom: 0;
}

width: 100%;
text-align: left;
display: block;
position: relative;
font-size: 1.25rem;
font-weight: 400;
line-height: 1.33;
padding: 10px 20px 10px 30px;
color: $c-black;
& .ma__utility-panel__item {
background-color: $c-gray-lightest;
color: $c-black;
margin: 0;
display: block;
}

&:hover {
text-decoration: underline;
& .ma__utility-panel__item .ma__decorative-link {
padding: 0;
}

& svg {
display: none;
& .ma__utility-panel__item .ma__decorative-link a {

@include ma-button-reset;

width: 100%;
text-align: left;
display: block;
position: relative;
font-size: 1.25rem;
font-weight: 400;
line-height: 1.33;
padding: 10px 20px 10px 30px;
color: $c-black;

&:hover {
text-decoration: underline;
}

& svg {
display: none;
}
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion assets/scss/03-organisms/_utility-nav.scss
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ $utility-nav-height: 43px;
text-align: left;
}

@media ($bp-header-toggle-max) {
@media ($bp-header-toggle-max) {// I MIGHT REMOVED IT TO REMOVE THE CHEVRON.

@include ma-chevron;

Expand Down
16 changes: 16 additions & 0 deletions changelogs/DP-19337.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
Changed:
- project: Patternlab
component: Header
description: Set only one menu is open at a time including the "log in to" content. (#1131)
issue: DP-19337
impact: Patch
- project: Patternlab
component: Header
description: Make the open/close animation consistent. (#1131)
issue: DP-19337
impact: Patch
- project: Patternlab
component: Header
description: Adjust the position of the bottom border of "Log In To…" content in the hamburger menu. (#1131)
issue: DP-19337
impact: Patch
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,8 @@
aria-label="Open the main menu for mass.gov"
class="ma__header__hamburger__menu-button js-header-menu-button">
<span class="ma__header__hamburger__menu-icon"></span>
{# Menu label with screen size greater than 620px. #}
<span class="ma__header__hamburger__menu-text ma__header__hamburger__desktop-label js-header__menu-text">Menu</span>
{# Menu label with screen size less than 620px. #}
<span class="ma__header__hamburger__menu-text ma__header__hamburger__mobile-label js-header__menu-text">Mass.gov</span>
{# Visible menu label is managed with CSS. The button has aria-label and the button label via aria-label is visible to screen reader users. #}
<span class="ma__header__hamburger__menu-text js-header__menu-text"></span>
</button>
{# Skip button to search. #}
<button type="button"
Expand Down
Loading