Fade in on open
.toast {
opacity: 1;
transition: opacity .35s ease;
}
@starting-style {
.toast { opacity: 0; }
}
The @starting-style at-rule defines the starting values used for an element's first style update. Pair it with transitions so dialogs and popovers can fade or slide in smoothly.
.toast {
opacity: 1;
transition: opacity .3s;
}
@starting-style {
.toast { opacity: 0; }
}.toast {
opacity: 1;
transition: opacity .35s ease;
}
@starting-style {
.toast { opacity: 0; }
}.panel {
transform: translateY(0);
transition: transform .3s;
@starting-style {
transform: translateY(12px);
}
}@starting-style is a modern CSS at-rule.
Check current browsers before relying on advanced behavior.
Bottom line: Use progressive enhancement. Keep a readable fallback when a browser ignores the at-rule.
Continue with @counter-style.
CODETOFUN NEWS
Get the latest IT news, programming updates, and technology trends directly on your phone.
Your daily dose of tech, straight to your feed.
3 people found this page helpful