diff --git a/src/components/site-header/hy-desktop-menu-links/hy-desktop-menu-links.scss b/src/components/site-header/hy-desktop-menu-links/hy-desktop-menu-links.scss index ab52bcf1c34dba087479632dd101f376391a651a..8a6ace3535423ac38a748b620da44a969fed8eb9 100644 --- a/src/components/site-header/hy-desktop-menu-links/hy-desktop-menu-links.scss +++ b/src/components/site-header/hy-desktop-menu-links/hy-desktop-menu-links.scss @@ -36,6 +36,16 @@ display: none; } + &--is-active-trail { + @include breakpoint($extrawide) { + border-bottom: 4px solid var(--brand-main-nearly-black); + padding-bottom: 8px; + } + + @include breakpoint($overwide) { + padding-bottom: 12px; + } + } &--is-active { background-color: var(--grayscale-background-box); padding: 35px 10px; @@ -216,27 +226,3 @@ top: 10px; } } - -/* -apply to desktop menu links upper level - &.hy-menu-item--desktop { - &.in-active-trail { - .hy-menu-item__label { - @include breakpoint($medium) { - border-bottom: 4px solid var(--brand-main-nearly-black); - padding-bottom: 8px; - } - - @include breakpoint($extrawide) { - padding-bottom: 8px; - padding-top: 14px; - } - - @include breakpoint($overwide) { - padding-top: 12px; - padding-bottom: 12px; - } - } - } - } - */ diff --git a/src/components/site-header/hy-desktop-menu-links/hy-desktop-menu-links.tsx b/src/components/site-header/hy-desktop-menu-links/hy-desktop-menu-links.tsx index f889fad19015ca4adcb9b342447bfd804f1c0ed3..41e9340b585f184a20ae1d6ec1686f9fc4eb8f9e 100644 --- a/src/components/site-header/hy-desktop-menu-links/hy-desktop-menu-links.tsx +++ b/src/components/site-header/hy-desktop-menu-links/hy-desktop-menu-links.tsx @@ -10,6 +10,7 @@ export interface DesktopLinks { url: string; description: string; menuLinkId: string; + isActive: string; items: Array<DesktopLinks>; shortcuts: Array<ShortcutLinks>; } @@ -96,10 +97,16 @@ export class HyDesktopMenuLinks { let firstLevelLinksList = []; links.forEach((item) => { - let className = 'desktop-menu-link'; + let classAttributes = [ + 'desktop-menu-link', + item.isActive === 'true' ? 'desktop-menu-link--is-active-trail' : '', + ].join(' '); + + //item.isActive ? classAttributes'desktop-menu-link--is-active-trail' : '' + firstLevelLinksList.push( <div - class={className} + class={classAttributes} link-id={item.menuLinkId} onMouseOver={() => this.handleMenuDesktopHover(item.menuLinkId)} onFocus={() => this.handleMenuDesktopHover(item.menuLinkId)}