Skip to content
Merged
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
13 changes: 9 additions & 4 deletions packages/raystack/components/dialog/dialog.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,19 @@
max-height: 85vh;
padding: 0;
position: fixed;
top: 50%;
top: 0;
left: 50%;
transition: opacity 150ms;
transform: translate(-50%, -50%);
/* translateY is the smaller of 160px (desired top offset) and
calc(50vh - 50%) (the y-coord that vertically centers the dialog,
where the inner 50% resolves to the element's own height). On tall
viewports the 160px branch wins; on short ones the centered branch
wins, so the dialog stays inside the viewport on resize. */
transform: translate(-50%, min(160px, calc(50vh - 50%)));
}

.dialogContent.showNestedAnimation {
transform: translate(-50%, -50%)
transform: translate(-50%, min(160px, calc(50vh - 50%)))
scale(calc(1 - 0.1 * var(--nested-dialogs, 0)));
translate: 0 calc(0px + 1.25rem * var(--nested-dialogs, 0));
}
Expand All @@ -47,7 +52,7 @@
.dialogContent.showNestedAnimation[data-starting-style],
.dialogContent.showNestedAnimation[data-ending-style] {
opacity: 0;
transform: translate(-50%, -50%) scale(0.9);
transform: translate(-50%, min(160px, calc(50vh - 50%))) scale(0.9);
}

.close {
Expand Down
Loading