CSS tip: animate elements in when they appear, even from display: none.
.toast {
transition: opacity .3s, translate .3s;
@starting-style {
opacity: 0;
translate: 0 12px;
}
}
No JS, no "add a class on the next frame" hack. Older browsers just show it instantly.
CSS tip: animate elements in when they appear, even from display: none. .toast { transition: opacity .3s, translate .3s; @starting-style { opacity: 0; translate: 0 12px; } } No JS, no "add a class on the next frame" hack. Older browsers just show it instantly.
0 vue
Publié le 13/11/2026 11:15
CSS tip: animate elements in when they appear, even from display: none.
.toast {
transition: opacity .3s, translate .3s;
@starting-style {
opacity: 0;
translate: 0 12px;
}
}
No JS, no "add a class on the next frame" hack. Older browsers just show it instantly.
0 commentaire
?