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

Merge branch 'NXSTAGE-1002-mobile-menu-fixes' into 'development'

NXSTAGE-1002: Mobile menu fixes

See merge request julkiset-sivut/design-system-lib!93
parents 7b05e2b8 7e664954
No related branches found
No related tags found
No related merge requests found
...@@ -65,12 +65,13 @@ ...@@ -65,12 +65,13 @@
:host(.hy-menu-item) { :host(.hy-menu-item) {
a { a {
@include font-size(15px, 20px); @include font-size(16px, 20px);
@include font-weight($regular); @include font-weight($regular);
align-items: center; align-items: center;
color: var(--brand-main-nearly-black); color: var(--brand-main-nearly-black);
display: flex; display: flex;
font-family: var(--main-font-family); font-family: var(--main-font-family);
letter-spacing: -0.5px;
padding: 24px 16px; padding: 24px 16px;
text-decoration: none; text-decoration: none;
width: 100%; width: 100%;
...@@ -83,10 +84,9 @@ ...@@ -83,10 +84,9 @@
&.hy-menu-item--mobile { &.hy-menu-item--mobile {
background: linear-gradient(270deg, var(--grayscale-background-box) 0%, var(--grayscale-light) 100%); 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: 14px 12px 14px 20px;
&.is-active, &.is-active {
&.in-active-trail {
@include font-weight($bold); @include font-weight($bold);
color: var(--grayscale-black); color: var(--grayscale-black);
position: relative; position: relative;
...@@ -217,7 +217,7 @@ ...@@ -217,7 +217,7 @@
align-items: center; align-items: center;
background: linear-gradient(270deg, var(--grayscale-background-box) 0%, var(--grayscale-light) 100%); 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 dotted var(--brand-main-light);
border-right: 0; border-right: 0;
border-top: 0; border-top: 0;
cursor: pointer; cursor: pointer;
......
...@@ -212,7 +212,7 @@ export class MenuItem { ...@@ -212,7 +212,7 @@ export class MenuItem {
onClick={() => this.handleClick()} onClick={() => this.handleClick()}
class={'hy-menu-item__button'} class={'hy-menu-item__button'}
> >
<hy-icon icon={'hy-icon-caret-right'} size={12} /> <hy-icon icon={'hy-icon-caret-right'} size={14} />
</button> </button>
)} )}
......
...@@ -21,11 +21,12 @@ ...@@ -21,11 +21,12 @@
} }
&__label { &__label {
@include font-size(14px, 20px); @include font-size(16px, 20px);
@include font-weight($regular); @include font-weight($regular);
align-items: center; align-items: center;
color: var(--brand-main-light); color: var(--brand-main-light);
display: flex; display: flex;
letter-spacing: -0.5px;
margin-left: 6px; margin-left: 6px;
text-align: left; text-align: left;
......
...@@ -33,13 +33,17 @@ ...@@ -33,13 +33,17 @@
} }
} }
.hy-menu-container--mobile {
min-height: calc(100vh - 60px);
overflow-x: hidden;
overflow-y: visible;
padding-top: 32px;
}
.hy-menu { .hy-menu {
&--mobile { &--mobile {
-webkit-overflow-scrolling: touch; -webkit-overflow-scrolling: touch;
flex-flow: column; flex-flow: column;
min-height: calc(100vh - 60px);
overflow-x: hidden;
overflow-y: visible;
padding-left: 12px; padding-left: 12px;
padding-right: 12px; padding-right: 12px;
transform: translateX(100%); transform: translateX(100%);
...@@ -73,8 +77,10 @@ ...@@ -73,8 +77,10 @@
} }
&__logo-container { &__logo-container {
box-shadow: rgba(14, 104, 139, 0.2) 0 20px 20px -20px;
display: inline-block; display: inline-block;
padding: 16px; padding: 16px;
z-index: 100;
@include breakpoint($narrow) { @include breakpoint($narrow) {
padding: 16px 28px; padding: 16px 28px;
......
...@@ -133,38 +133,40 @@ export class Menu { ...@@ -133,38 +133,40 @@ export class Menu {
label={this.logoLabel} label={this.logoLabel}
/> />
</div> </div>
<div <div class="hy-menu-container--mobile">
id={'menu-bc-container'} <div
class={{ id={'menu-bc-container'}
'hy-menu__breadcrumbs': true, class={{
'is-empty': this.breadcrumbs.length === 0, 'hy-menu__breadcrumbs': true,
}} 'is-empty': this.breadcrumbs.length === 0,
> }}
<hy-menu-language is-mobile={true} data-menu-language={this.dataMenuLanguage} /> >
{this.breadcrumbs.length <hy-menu-language is-mobile={true} data-menu-language={this.dataMenuLanguage} />
? this.breadcrumbs.map((breadcrumb, index) => { {this.breadcrumbs.length
return ( ? this.breadcrumbs.map((breadcrumb, index) => {
<hy-menu-mobile-breadcrumb return (
label-back={this.menuButtonBreadcrumbReturn} <hy-menu-mobile-breadcrumb
label-front-page={this.labelFrontPage} label-back={this.menuButtonBreadcrumbReturn}
label={breadcrumb.label} label-front-page={this.labelFrontPage}
bid={breadcrumb.bid} label={breadcrumb.label}
is-first={index === 0} bid={breadcrumb.bid}
/> is-first={index === 0}
); />
}) );
: ''} })
</div> : ''}
<div </div>
aria-hidden={this.menuIsOpen ? 'false' : 'true'} <div
class={{ aria-hidden={this.menuIsOpen ? 'false' : 'true'}
'hy-menu': true, class={{
'hy-menu--mobile': true, 'hy-menu': true,
'is-open': this.menuIsOpen, 'hy-menu--mobile': true,
'is-demo': this.isDemo, 'is-open': this.menuIsOpen,
}} 'is-demo': this.isDemo,
> }}
<slot /> >
<slot />
</div>
</div> </div>
<div class={'hy-link__donate'}> <div class={'hy-link__donate'}>
{this.donateLink {this.donateLink
......
...@@ -55,7 +55,7 @@ ...@@ -55,7 +55,7 @@
bottom: 0; bottom: 0;
overflow: hidden; overflow: hidden;
padding: 0; padding: 0;
position: absolute; position: fixed;
right: 0; right: 0;
top: 0; top: 0;
transform: translateX(100%); transform: translateX(100%);
...@@ -86,7 +86,7 @@ ...@@ -86,7 +86,7 @@
} }
&.is-open { &.is-open {
position: absolute; position: fixed;
right: 0; right: 0;
top: 32px; top: 32px;
transform: translateY(-50%); transform: translateY(-50%);
...@@ -127,7 +127,7 @@ ...@@ -127,7 +127,7 @@
.hy-backdrop { .hy-backdrop {
bottom: 0; bottom: 0;
left: 0; left: 0;
position: absolute; position: fixed;
right: 0; right: 0;
top: 0; top: 0;
visibility: hidden; visibility: hidden;
......
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