From ca96865e37ef6b9231523d6b0762656daa84480b Mon Sep 17 00:00:00 2001 From: Abbey Hart Date: Mon, 2 Mar 2020 11:48:24 -0600 Subject: [PATCH 1/8] feat(header-menuitem): add isActive prop to apply style to selected item --- packages/components/src/components/ui-shell/_header.scss | 8 +++++++- packages/react/src/components/UIShell/HeaderMenuItem.js | 8 +++++++- packages/react/src/components/UIShell/UIShell-story.js | 4 +++- 3 files changed, 17 insertions(+), 3 deletions(-) diff --git a/packages/components/src/components/ui-shell/_header.scss b/packages/components/src/components/ui-shell/_header.scss index 319d37704e52..e71f9391a172 100644 --- a/packages/components/src/components/ui-shell/_header.scss +++ b/packages/components/src/components/ui-shell/_header.scss @@ -27,7 +27,6 @@ right: 0; height: mini-units(6); background-color: $shell-header-bg-01; - border-bottom: 1px solid $shell-header-border-01; z-index: z('header'); } @@ -219,6 +218,13 @@ fill: $shell-header-icon-01; } + a.#{$prefix}--header__menu-item[aria-current='page'] { + color: $shell-header-text-01; + border-left: 0; + border-right: 0; + border-bottom: 3px solid $inverse-support-04; + } + .#{$prefix}--header__submenu { position: relative; } diff --git a/packages/react/src/components/UIShell/HeaderMenuItem.js b/packages/react/src/components/UIShell/HeaderMenuItem.js index 6dc4fc5f55ea..2d03db67884c 100644 --- a/packages/react/src/components/UIShell/HeaderMenuItem.js +++ b/packages/react/src/components/UIShell/HeaderMenuItem.js @@ -13,13 +13,14 @@ import Link, { LinkPropTypes } from './Link'; const { prefix } = settings; const HeaderMenuItem = React.forwardRef(function HeaderMenuItem( - { className, children, role, ...rest }, + { className, isActive, children, role, ...rest }, ref ) { return (
  • @@ -52,6 +53,11 @@ HeaderMenuItem.propTypes = { *