Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(cxl-ui): fix mobile layout issues in course pages #377

Merged
merged 2 commits into from
Jan 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion packages/cxl-lumo-styles/scss/themes/cxl-accordion-card.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
@import "~@conversionxl/cxl-ui/scss/cxl-card";
@use "~@conversionxl/cxl-lumo-styles/scss/mq";
@use "~@conversionxl/cxl-ui/scss/cxl-card";

:host(:not[disabled]) {
[part="summary"]:hover {
Expand Down Expand Up @@ -43,3 +44,14 @@
display: flex;
flex-wrap: wrap;
}

:host {
box-sizing: border-box;
max-width: calc(100vw - 2 * var(--cxl-wrap-padding));
}

@media #{mq.$small} {
:host {
max-width: initial;
}
}
37 changes: 8 additions & 29 deletions packages/cxl-lumo-styles/scss/themes/vaadin-overlay.scss
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,9 @@

&::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);
/* Repeated as fallback for older browsers */
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;
align-items: stretch !important;
justify-content: flex-end !important;
width: 100vw;
/* Repeated as fallback for older browsers*/
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
1 change: 0 additions & 1 deletion packages/cxl-ui/src/components/cxl-marketing-nav.js
Original file line number Diff line number Diff line change
Expand Up @@ -375,7 +375,6 @@ export class CXLMarketingNavElement extends LitElement {
const overflowMenuButton = menu.shadowRoot.querySelector(
'vaadin-menu-bar-button[part="overflow-button"]'
);
overflowMenuButton.toggleAttribute('hidden', false);

if (overflowMenuButton && !overflowMenuButton.iconFixed) {
const menuIcon = document.createElement('vaadin-icon');
Expand Down
Loading