Loading...
li:nth-child(1) { animation-delay: 0ms; }
li:nth-child(2) { animation-delay: 100ms; }
li:nth-child(3) { animation-delay: 200ms; }li {
animation-delay: calc((sibling-index() - 1) * 100ms);
}One rule replaces a list of :nth-child rules, and subtracting 1 starts the first item with no delay.
calc(sibling-index() * 100ms) instead of many :nth-child rules or inline indexes.It starts at 1 for the first child. Subtract 1 inside calc() when the first item should get a zero value.
No. It is a value function used in declarations; use :nth-child() to select elements by position.