Skip to content

Commit eed38b7

Browse files
fix(cc-dialog): make close button position responsive on narrow screens
The close button position is now derived from the dialog padding, ensuring it stays properly positioned when the padding changes on narrow screens.
1 parent 85d5ae6 commit eed38b7

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/components/cc-dialog/cc-dialog.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,6 +230,7 @@ export class CcDialog extends LitElement {
230230
231231
.dialog-close {
232232
--close-btn-size: 2em;
233+
--close-btn-offset: calc(var(--cc-dialog-padding, var(--default-dialog-padding)) / 1.5);
233234
234235
align-items: center;
235236
background: none;
@@ -244,7 +245,7 @@ export class CcDialog extends LitElement {
244245
margin-top: calc(var(--close-btn-size) * -1);
245246
position: sticky;
246247
top: 0;
247-
transform: translate(2.75em, -2.75em);
248+
transform: translate(var(--close-btn-offset), calc(var(--close-btn-offset) * -1));
248249
width: var(--close-btn-size);
249250
}
250251

0 commit comments

Comments
 (0)