Skip to content
Snippets Groups Projects
Commit e7eb1863 authored by shamalainen's avatar shamalainen
Browse files

Add active state for the menu item heading

parent af0a9e5d
No related branches found
No related tags found
No related merge requests found
// Mobile. // Mobile.
:host(.hy-menu-item--mobile) { :host(.hy-menu-item--mobile) {
--menu-item-display: flex; --menu-item-display: flex;
background: linear-gradient(270deg, var(--grayscale-background-box) 0%, var(--grayscale-light) 100%);
display: flex; display: flex;
margin-left: 12px; margin-left: 12px;
margin-right: 12px; margin-right: 12px;
...@@ -117,6 +116,7 @@ a { ...@@ -117,6 +116,7 @@ a {
} }
&.hy-menu-item--mobile { &.hy-menu-item--mobile {
background: linear-gradient(270deg, var(--grayscale-background-box) 0%, var(--grayscale-light) 100%);
color: var(--brand-main-light); color: var(--brand-main-light);
padding: 12px 12px 12px 20px; padding: 12px 12px 12px 20px;
...@@ -136,6 +136,30 @@ a { ...@@ -136,6 +136,30 @@ a {
transform: translate(-50%, -50%); transform: translate(-50%, -50%);
} }
} }
&.is-heading {
@include font-size(24px, 24px);
@include font-weight($bold);
background: transparent;
border-bottom: 3px solid var(--brand-main-light);
color: var(--brand-main-light);
margin-top: -24px;
padding-bottom: 24px;
padding-top: 24px;
text-transform: uppercase;
&.is-active,
&.in-active-trail {
@include font-weight($bold);
color: var(--grayscale-black);
position: relative;
&:before {
border-left-width: 4px;
height: 55%;
}
}
}
} }
&.hy-menu-item--desktop { &.hy-menu-item--desktop {
...@@ -273,7 +297,7 @@ a { ...@@ -273,7 +297,7 @@ a {
.hy-menu-item__button { .hy-menu-item__button {
align-items: center; align-items: center;
background: transparent; background: linear-gradient(270deg, var(--grayscale-background-box) 0%, var(--grayscale-light) 100%);
border-bottom: 0; border-bottom: 0;
border-left: 1px dashed var(--brand-main-light); border-left: 1px dashed var(--brand-main-light);
border-right: 0; border-right: 0;
......
...@@ -98,6 +98,10 @@ export class MenuLevelContainer { ...@@ -98,6 +98,10 @@ export class MenuLevelContainer {
...this.headingItem, ...this.headingItem,
label: parentMenuItem.getAttribute('label'), label: parentMenuItem.getAttribute('label'),
}; };
this.headingItem = {
...this.headingItem,
isActive: window.location.pathname === this.headingItem.url,
};
} else { } else {
this.triggerItem = 'home'; this.triggerItem = 'home';
} }
...@@ -149,6 +153,7 @@ export class MenuLevelContainer { ...@@ -149,6 +153,7 @@ export class MenuLevelContainer {
label={this.headingItem.label} label={this.headingItem.label}
url={this.headingItem.url} url={this.headingItem.url}
isHeading={true} isHeading={true}
isActive={this.headingItem.isActive}
menu-type={'mobile'} menu-type={'mobile'}
/> />
<slot /> <slot />
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment