@starting-style
Newly availableSince 202493% of users
Allows you to define the initial styles for an element for its 'entry' animation. It lets you animate elements (like modals or dropdowns) as they are added to the DOM without using JavaScript timeouts.
What's modern
From web-features, MDN's browser data and our snippets, checked dailyModernIn every major browser since August 2024. Widely available around February 2027.
The old way and the modern waySee the snippet: Entry animations without JavaScript timing →
Old way 15 lines
.card {
opacity: 0;
transform: translateY(10px);
transition: opacity .3s, transform .3s;
}
.card.visible {
opacity: 1;
transform: none;
}
/* JS: must run after paint, or the transition won't run */
requestAnimationFrame(() => {
requestAnimationFrame(() => {
el.classList.add('visible');
});
});Modern 7 lines
.card {
transition: opacity .3s, transform .3s;
@starting-style {
opacity: 0;
transform: translateY(10px);
}
}See how modern your own CSS is.Check your CSS →
Quick example
div {
transition: opacity 0.5s, transform 0.5s;
opacity: 1;
transform: scale(1);
/* Styles applied the moment the element is created/displayed */
@starting-style {
opacity: 0;
transform: scale(0.9);
}
}Related snippet
Entry animations without JavaScript timingAnimation →@starting-style browser support
BaselineNewly availableSince 2024 this feature works across the latest devices and browser versions. This feature might not work in older devices or browsers.Works in all modern browsers. May need a fallback for older browsers.
Usage93%of people can use this7% use a browser without it.
Browsers
117+
129+
17.5+
117+Mobile
117+Android
129+Android
17.5+iOS