Skip to content

Commit 0b542da

Browse files
committed
fix: use the :modal attribute for modal styling to fix safari issues
1 parent 6cad49e commit 0b542da

2 files changed

Lines changed: 5 additions & 5 deletions

File tree

app/assets/main.css

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -556,12 +556,12 @@ input[type='search']::-webkit-search-results-decoration {
556556
}
557557

558558
/* Locking the scroll whenever any of the modals are open */
559-
html:has(dialog:open) {
559+
html:has(dialog:modal) {
560560
overflow: hidden;
561561
}
562562

563563
/* Backdrop styling when any of the modals are open */
564-
dialog:open::backdrop {
564+
dialog:modal::backdrop {
565565
@apply bg-black/60;
566566
}
567567

@@ -572,14 +572,14 @@ dialog {
572572
transition-behavior: allow-discrete;
573573
}
574574

575-
dialog:open {
575+
dialog:modal {
576576
opacity: 1;
577577
transition: opacity 200ms ease;
578578
transition-behavior: allow-discrete;
579579
}
580580

581581
@starting-style {
582-
dialog:open {
582+
dialog[modal] {
583583
opacity: 0;
584584
}
585585
}

app/components/Modal.client.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ defineProps<{
44
}>()
55
66
function handleModalClose() {
7-
const modal = document.querySelector<HTMLDialogElement>('dialog[open]')
7+
const modal = document.querySelector<HTMLDialogElement>('dialog:modal')
88
if (modal) {
99
modal.close()
1010
}

0 commit comments

Comments
 (0)