<sibling-count>
Newly availableSince 202686% of users
Returns how many elements share the element's parent, the element itself included. It lets you style items by how many there are in a list, without JavaScript.
What's modern
From web-features, MDN's browser data and our snippets, checked dailyModernIn every major browser since August 2026. Widely available around February 2029.
The old way and the modern waySee the snippet: Staggered animations without nth-child hacks →
Old way 17 lines
/* Manual index per nth-child */
li:nth-child(1) {
--i: 0;
}
li:nth-child(2) {
--i: 1;
}
li:nth-child(3) {
--i: 2;
}
li:nth-child(4) {
--i: 3;
}
/* … repeat for every item … */
li {
transition-delay: calc(0.1s * var(--i));
}Modern 6 lines
@media (prefers-reduced-motion: no-preference) {
li {
transition: opacity .25s ease, translate .25s ease;
transition-delay: calc(0.1s * (sibling-index() - 1));
}
}See how modern your own CSS is.Check your CSS →
Quick example
.grid-item {
/* Make items larger if there are only a few in the list */
width: calc(100% / sibling-count());
}Related snippet
Staggered animations without nth-child hacksAnimation →<sibling-count> browser support
BaselineNewly availableSince 2026 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.
Usage86%of people can use this14% use a browser without it.
Browsers
138+
154+
26.2+
138+Mobile
138+Android
154+Android
26.2+iOS