<sibling-count>

A new experimental function that returns the total number of siblings an element has. This allows you to style elements based on how many items are currently in a list without using JavaScript.

Quick example

.grid-item {
  /* Make items larger if there are only a few in the list */
  width: calc(100% / sibling-count());
}

<sibling-count> Browser Support

Limited availability 70% global usage

This feature is not Baseline because it does not work in some of the most widely-used browsers.

Not ready for production without a fallback.

138+
26.2+
138+
ESC