#viewport-container [data-state='open'] {
animation: scaleIn 200ms ease;
}
#viewport-container [data-state='closed'] {
animation: scaleOut 200ms ease;
}
@keyframes scaleIn {
from {
opacity: 0;
transform: rotateX(-30deg) scale(0.9);
}
to {
opacity: 1;
transform: rotateX(0deg) scale(1);
}
}
@keyframes scaleOut {
from {
opacity: 1;
transform: rotateX(0deg) scale(1);
}
to {
opacity: 0;
transform: rotateX(-10deg) scale(0.95);
}
}
and then add viewport-container to the ID field on the viewport div.
I'm also working on a lightweight animation lib that makes sit easier to animate radix and regular components