Skip to content

Commit 7302743

Browse files
fix(styles): fix bottom margin for buttons inside <dialog> element when content becomes scrollable (#6414)
## 📄 Description This PR fixes bottom margin for buttons inside <dialog> element when content becomes scrollable ## 🚀 Preview link: [The Dialog](https://preview-6414--swisspost-design-system-next.netlify.app/?path=/docs/562eac2b-6dc1-4007-ba8e-4e981cef0cbc--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 --------- Co-authored-by: Lea <[email protected]>
1 parent 35ec21c commit 7302743

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

.changeset/eleven-towns-camp.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@swisspost/design-system-styles': patch
3+
---
4+
5+
Fixed bottom margin for buttons inside `<dialog>` element when content becomes scrollable.

packages/styles/src/components/dialog.scss

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ dialog {
7575
}
7676

7777
dialog > .dialog-grid {
78-
padding: tokens.get('utility-gap-16');
78+
padding: tokens.get('utility-gap-16') tokens.get('utility-gap-16') 0;
7979
display: grid;
8080
column-gap: tokens.get('utility-gap-16');
8181
grid-template-columns: auto 1fr auto;
@@ -86,6 +86,10 @@ dialog > .dialog-grid {
8686

8787
// Propagate bg color to the controls
8888
background-color: inherit;
89+
90+
&:not(:has(.dialog-controls)) {
91+
padding-bottom: tokens.get('utility-gap-16');
92+
}
8993
}
9094

9195
:where(.dialog-icon, .dialog-header, .dialog-body, .dialog-controls, .dialog-close):empty {
@@ -160,6 +164,8 @@ dialog > .dialog-grid {
160164
position: sticky;
161165
bottom: 0;
162166
padding-top: tokens.get('utility-gap-16');
167+
padding-bottom: tokens.get('utility-gap-16');
168+
margin-block-end: 0;
163169
display: flex;
164170
flex-wrap: wrap;
165171
flex-direction: row-reverse;

0 commit comments

Comments
 (0)