From eb9412f9d32f656924fa852f2646d6b4b3dd3c84 Mon Sep 17 00:00:00 2001 From: TJ Egan Date: Fri, 31 Jan 2020 15:05:34 -0800 Subject: [PATCH 1/7] fix(ui-shell): remove role='menu' from ui-shell (#5235) --- .../src/components/ui-shell/_header.scss | 4 +-- .../src/components/ui-shell/_side-nav.scss | 21 ++++++-------- .../src/components/ui-shell/header-nav.hbs | 12 ++++---- .../components/ui-shell/navigation-menu.hbs | 18 +++++++----- .../components/ui-shell/side-nav-fixed.hbs | 20 ++++++------- .../src/components/ui-shell/side-nav.hbs | 28 +++++++++++-------- .../src/components/UIShell/HeaderMenu.js | 15 ++-------- .../src/components/UIShell/SideNavMenu.js | 4 +-- .../react/src/components/UIShell/Switcher.js | 2 +- .../src/components/UIShell/UIShell-story.js | 2 +- .../__snapshots__/HeaderMenu-test.js.snap | 16 ++--------- .../__snapshots__/SideNavMenu-test.js.snap | 1 - 12 files changed, 64 insertions(+), 79 deletions(-) diff --git a/packages/components/src/components/ui-shell/_header.scss b/packages/components/src/components/ui-shell/_header.scss index 78f2b0fc8d4f..d4fb4dc67037 100644 --- a/packages/components/src/components/ui-shell/_header.scss +++ b/packages/components/src/components/ui-shell/_header.scss @@ -167,7 +167,7 @@ } } - .#{$prefix}--header__menu-bar[role='menubar'] { + .#{$prefix}--header__menu-bar { display: flex; height: 100%; list-style: none; @@ -240,7 +240,7 @@ transform: rotate(180deg); } - .#{$prefix}--header__menu[role='menu'] { + .#{$prefix}--header__menu { display: none; list-style: none; padding: 0; diff --git a/packages/components/src/components/ui-shell/_side-nav.scss b/packages/components/src/components/ui-shell/_side-nav.scss index 3aee0dac9da9..c3879da74ca4 100644 --- a/packages/components/src/components/ui-shell/_side-nav.scss +++ b/packages/components/src/components/ui-shell/_side-nav.scss @@ -328,8 +328,8 @@ > .#{$prefix}--side-nav__submenu:hover, .#{$prefix}--side-nav__item:not(.#{$prefix}--side-nav__item--active) > .#{$prefix}--side-nav__link:hover, - .#{$prefix}--side-nav__menu[role='menu'] - a.#{$prefix}--side-nav__link[role='menuitem']:not(.#{$prefix}--side-nav__link--current):not([aria-current='page']):hover, + .#{$prefix}--side-nav__menu + a.#{$prefix}--side-nav__link:not(.#{$prefix}--side-nav__link--current):not([aria-current='page']):hover, .#{$prefix}--side-nav a.#{$prefix}--header__menu-item:hover, .#{$prefix}--side-nav .#{$prefix}--header__menu-title[aria-expanded='true']:hover { @@ -433,20 +433,19 @@ color: $ibm-color__gray-100; } - .#{$prefix}--side-nav__menu[role='menu'] { + .#{$prefix}--side-nav__menu { display: block; visibility: hidden; max-height: 0; } .#{$prefix}--side-nav__submenu[aria-expanded='true'] - + .#{$prefix}--side-nav__menu[role='menu'] { + + .#{$prefix}--side-nav__menu { max-height: rem(1500px); visibility: inherit; } - .#{$prefix}--side-nav__menu[role='menu'] - a.#{$prefix}--side-nav__link[role='menuitem'] { + .#{$prefix}--side-nav__menu a.#{$prefix}--side-nav__link { height: mini-units(4); min-height: mini-units(4); padding-left: mini-units(4); @@ -454,13 +453,11 @@ } .#{$prefix}--side-nav__item.#{$prefix}--side-nav__item--icon - a.#{$prefix}--side-nav__link[role='menuitem'] { + a.#{$prefix}--side-nav__link { padding-left: mini-units(9); } - .#{$prefix}--side-nav__menu[role='menu'] - a.#{$prefix}--side-nav__link--current, - .#{$prefix}--side-nav__menu[role='menu'] - a.#{$prefix}--side-nav__link[aria-current='page'], + .#{$prefix}--side-nav__menu a.#{$prefix}--side-nav__link--current, + .#{$prefix}--side-nav__menu a.#{$prefix}--side-nav__link[aria-current='page'], a.#{$prefix}--side-nav__link--current { background-color: $ibm-color__gray-20; @@ -584,7 +581,7 @@ } .#{$prefix}--side-nav--fixed - .#{$prefix}--side-nav__menu[role='menu'] + .#{$prefix}--side-nav__menu a.#{$prefix}--side-nav__link { padding-left: mini-units(4); } diff --git a/packages/components/src/components/ui-shell/header-nav.hbs b/packages/components/src/components/ui-shell/header-nav.hbs index 6018b2c21d53..7c67a16deadc 100644 --- a/packages/components/src/components/ui-shell/header-nav.hbs +++ b/packages/components/src/components/ui-shell/header-nav.hbs @@ -1,4 +1,4 @@ -