Skip to content

Commit

Permalink
fix: fadein animation not working on dialog
Browse files Browse the repository at this point in the history
  • Loading branch information
david-abell committed Oct 13, 2023
1 parent b89726d commit f8f1acc
Showing 1 changed file with 15 additions and 6 deletions.
21 changes: 15 additions & 6 deletions Modal.astro
Original file line number Diff line number Diff line change
Expand Up @@ -147,17 +147,11 @@ const { triggerId, title, closeText = 'Close' } = Astro.props
padding: 0;
}

.modal .modal__inner {
opacity: 1;
}

.modal__inner {
width: clamp(30ch, 70%, 75ch);
color: black;
background-color: white;
border-radius: 1rem;
opacity: 0;
transition: opacity 0.3s ease-in-out;
}

.modal__inner {
Expand Down Expand Up @@ -194,4 +188,19 @@ const { triggerId, title, closeText = 'Close' } = Astro.props
background-color: grey;
text-decoration: underline;
}

/* Animation */
dialog[open],
dialog[open]::backdrop {
animation: fadein 0.3s ease-in-out;
}

@keyframes fadein {
from {
opacity: 0;
}
to {
opacity: 1;
}
}
</style>

0 comments on commit f8f1acc

Please # to comment.