Skip to content

Commit

Permalink
fix(cxl-lumo-styles): simplify vaadin-overlay theme for nav mobile la…
Browse files Browse the repository at this point in the history
…yout
  • Loading branch information
freudFlintstone committed Dec 19, 2023
1 parent e48d43a commit 7c95394
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 28 deletions.
35 changes: 7 additions & 28 deletions packages/cxl-lumo-styles/scss/themes/vaadin-overlay.scss
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,8 @@
&::part(overlay),
&::part(content) {
/* Repeated as fallback for older browsers */
height: calc(100vh - 40px);
height: calc(100dvh - 40px);
max-height: calc(100vh - 40px);
max-height: calc(100dvh - 40px);
max-height: calc(100% - var(--cxl-marketing-nav-height));
max-height: calc(100dvh - var(--cxl-marketing-nav-height));
}

&::part(backdrop) {
Expand All @@ -50,42 +48,23 @@
0 8px 24px -4px var(--lumo-shade-5pct);
}

&::part(overlay),
&::part(content) {
height: initial;
max-height: initial;
}

&::part(content) {
padding: var(--lumo-space-s);
}

/* It's necessary to define some properties again in a media query, because of vaadin-overlay hard coded styles at 420px*/
@media (max-width: 568px), (max-height: 568px) {
top: 0 !important;
right: 0 !important;
bottom: var(--vaadin-overlay-viewport-bottom, 0) !important;
left: 0 !important;
align-items: stretch !important;
justify-content: flex-end !important;


[part='overlay'] {
top: 0 !important;
right: 0 !important;
position: relative;
height: 100dvh;
max-height: calc(100dvh - var(--cxl-marketing-nav-height));
bottom: var(--vaadin-overlay-viewport-bottom, 0) !important;
left: 0 !important;

/* Necessary to override hard-coded media query from vaadin-overlay style at 420px*/
align-items: stretch !important;
justify-content: flex-end !important;
height: calc(100vh - 40px) !important;
height: calc(100dvh - 40px) !important;
max-height: calc(100vh - 40px) !important;
max-height: calc(100dvh - 40px) !important;

border-top: 1px solid var(--lumo-shade-5pct);
border-radius: 0;
box-shadow: none;
width: 100%;
}

/* The content part scrolls instead of the overlay part, because of the gradient fade-out */
Expand Down
1 change: 1 addition & 0 deletions packages/cxl-ui/scss/cxl-marketing-nav.scss
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
justify-content: center;
width: 100%;
max-width: 100vw;
min-height: var(--cxl-marketing-nav-min-height, 44px);
padding: 0 var(--lumo-space-m);
overflow: hidden;

Expand Down

0 comments on commit 7c95394

Please sign in to comment.