Skip to content

Commit 9943bd4

Browse files
authored
fix(components): update section container in the megadropdown (#7004)
## 📄 Description This PR fixes an issue with the newly introduced container for the header and megadropdown content which was causing incorrect layout on tablet and mobile. ## 🚀 Demo https://preview-7004--swisspost-design-system-next.netlify.app/?path=/docs/27a2e64d-55ba-492d-ab79-5f7c5e818498--docs --- ## 🔮 Design review - [ ] Design review done - [x] No design review needed ## 📝 Checklist - ✅ My code follows the style guidelines of this project - 🛠️ I have performed a self-review of my own code - 📄 I have made corresponding changes to the documentation - ⚠️ My changes generate no new warnings or errors - 🧪 I have added tests that prove my fix is effective or that my feature works - ✔️ New and existing unit tests pass locally with my changes
1 parent 62b8313 commit 9943bd4

File tree

1 file changed

+22
-21
lines changed

1 file changed

+22
-21
lines changed

packages/components/src/components/post-megadropdown/post-megadropdown.scss

Lines changed: 22 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,6 @@
2020
z-index: -1;
2121
inset-block-start: 100%;
2222

23-
.section {
24-
max-height: calc(100vh - var(--post-header-height) - 3rem);
25-
padding: 2rem 2.5rem 2.5rem;
26-
}
27-
2823
&.slide-in {
2924
animation: slide-down 350ms forwards;
3025
}
@@ -38,23 +33,35 @@
3833
z-index: 1;
3934
inset-block-start: var(--post-header-navigation-current-inset);
4035
overscroll-behavior: contain;
41-
display: flex;
42-
flex-direction: column;
43-
44-
.section {
45-
height: calc(
46-
min(var(--post-header-scroll-parent-height, 100dvh), 100dvh) - var(--post-header-height)
47-
);
48-
padding-inline: var(--post-burger-menu-padding-inline);
49-
padding-block: 1.5rem;
50-
}
5136
}
5237

5338
@include utilities.high-contrast-mode() {
5439
border-block-end: 1px solid CanvasText;
5540
}
5641
}
5742

43+
.section {
44+
width: 100%;
45+
max-width: var(--post-header-content-max-width);
46+
margin-inline: auto;
47+
position: relative;
48+
49+
@include media.only(desktop) {
50+
max-height: calc(100vh - var(--post-header-height) - 3rem);
51+
padding: 2rem 2.5rem 2.5rem;
52+
}
53+
54+
@include media.max(desktop) {
55+
display: flex;
56+
flex-direction: column;
57+
height: calc(
58+
min(var(--post-header-scroll-parent-height, 100dvh), 100dvh) - var(--post-header-height)
59+
);
60+
padding-inline: var(--post-burger-menu-padding-inline);
61+
padding-block: 1.5rem;
62+
}
63+
}
64+
5865
.megadropdown-title {
5966
margin-block: 0 1rem;
6067
font-weight: 950;
@@ -98,9 +105,3 @@
98105
display: none;
99106
}
100107
}
101-
102-
.section {
103-
max-width: var(--post-header-content-max-width);
104-
margin-inline: auto;
105-
position: relative;
106-
}

0 commit comments

Comments
 (0)