Re: [csswg-drafts] [css-values] Proposal: add sibling-count() and sibling-index() (#4559)

I appreciate and agree with the responses to my last question. Thank you!

---

Might these related functions be folded into one?

Borrowing from an earlier example:

```pcss
/* stagger the animation, start to end */
.animate > g {
  animation-delay: calc(this(sibling-index) * 100ms);
}

/* stagger the animation, end to start */
.animate > g {
  animation-delay: calc(this(sibling-count) - this(sibling-index) * 100ms);
}
```

I experienced slowness reading `sibling-index()` as a query of the current element and not a sibling. My sense of context tanked after I read the comment about future extensions that might look something like `sibling-index(of <selector>)`. I felt clarity when writing out `this(sibling-index)` and `this(sibling-index of <selector>)`.

Anyway, this is my own experience I’m sharing in case other people feel the same clarity after seeing the above example.

-- 
GitHub Notification of comment by jonathantneal
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/4559#issuecomment-584222385 using your GitHub account

Received on Monday, 10 February 2020 16:56:47 UTC