Skip to content
Snippets Groups Projects
Commit 3f1591f4 authored by Tuukka Turu's avatar Tuukka Turu
Browse files

Merge branch 'development'

parents b0e5398e 9f85b016
No related branches found
No related tags found
No related merge requests found
...@@ -266,9 +266,8 @@ ...@@ -266,9 +266,8 @@
} }
} }
// menu item links // Second level menu item links
&__second-level-menu { &__second-level-menu {
//background-color: var(--grayscale-background-box);
background-color: var(--grayscale-white); background-color: var(--grayscale-white);
list-style: none; list-style: none;
margin: 0; margin: 0;
...@@ -308,12 +307,18 @@ ...@@ -308,12 +307,18 @@
&:hover, &:hover,
&:focus { &:focus {
color: var(--link-blue); color: var(--link-blue);
span.external-icon {
svg {
fill: var(--link-blue);
}
}
} }
.label { .label {
@include breakpoint($extrawide) { @include breakpoint($extrawide) {
border: none; border: none;
margin-left: 12px; margin: 0 5px 0 12px;
padding-top: 12px; padding-top: 12px;
padding-bottom: 12px; padding-bottom: 12px;
} }
...@@ -327,6 +332,18 @@ ...@@ -327,6 +332,18 @@
} }
} }
} }
span.external-icon {
svg {
fill: var(--brand-main-nearly-black);
transform: rotate(-45deg);
&:hover,
&:focus {
fill: var(--link-blue);
}
}
}
} }
} }
} }
......
...@@ -11,6 +11,7 @@ export interface DesktopLinks { ...@@ -11,6 +11,7 @@ export interface DesktopLinks {
url: string; url: string;
description: string; description: string;
menuLinkId: string; menuLinkId: string;
isExternal: string;
isActive: string; isActive: string;
shortcutsTitle: string; shortcutsTitle: string;
closeButtonTitle: string; closeButtonTitle: string;
...@@ -307,6 +308,7 @@ export class HyDesktopMenuLinks { ...@@ -307,6 +308,7 @@ export class HyDesktopMenuLinks {
description, description,
label, label,
labelExtra, labelExtra,
isExternal,
isActive, isActive,
shortcutsTitle, shortcutsTitle,
closeButtonTitle, closeButtonTitle,
...@@ -319,6 +321,7 @@ export class HyDesktopMenuLinks { ...@@ -319,6 +321,7 @@ export class HyDesktopMenuLinks {
'desktop-menu-link__label', 'desktop-menu-link__label',
isActive === 'true' ? 'desktop-menu-link__label--is-active-trail' : '', isActive === 'true' ? 'desktop-menu-link__label--is-active-trail' : '',
].join(' '); ].join(' ');
let target = isExternal ? '_blank' : '_self';
menuLinkItems.push( menuLinkItems.push(
<li> <li>
...@@ -341,6 +344,7 @@ export class HyDesktopMenuLinks { ...@@ -341,6 +344,7 @@ export class HyDesktopMenuLinks {
<a <a
aria-current={label} aria-current={label}
href={url} href={url}
target={target}
class="hy-desktop-menu-panel__desktop-menu__first-level-menu-item" class="hy-desktop-menu-panel__desktop-menu__first-level-menu-item"
menu-link-id={id} menu-link-id={id}
> >
...@@ -351,16 +355,24 @@ export class HyDesktopMenuLinks { ...@@ -351,16 +355,24 @@ export class HyDesktopMenuLinks {
{description && <span class="description">{description}</span>} {description && <span class="description">{description}</span>}
</a> </a>
<ul class={'hy-desktop-menu-panel__desktop-menu__second-level-menu'} menu-link-id={id}> <ul class={'hy-desktop-menu-panel__desktop-menu__second-level-menu'} menu-link-id={id}>
{items.map(({label, url}) => ( {items.map(({label, url, isExternal}) => {
<li> let subitemTarget = isExternal ? '_blank' : '_self';
<a href={url}> return (
<span class="heading-icon"> <li>
<hy-icon icon={'hy-icon-caret-right'} size={12} /> <a href={url} target={subitemTarget}>
</span> <span class="heading-icon">
<span class="label">{label}</span> <hy-icon icon={'hy-icon-caret-right'} size={12} />
</a> </span>
</li> <span class="label">{label}</span>
))} {isExternal && (
<span class="external-icon">
<hy-icon icon={'hy-icon-arrow-right'} size={12} />
</span>
)}
</a>
</li>
);
})}
</ul> </ul>
</div> </div>
{shortcuts.length > 0 && ( {shortcuts.length > 0 && (
......
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