[csswg-drafts] [css-values-5] Why is `sibling-count()` self-including? (#12062)

nt1m has just created a new issue for https://github.com/w3c/csswg-drafts:

== [css-values-5] Why is `sibling-count()` self-including? ==
I just discovered today that `sibling-count()` is self-including today:

> The sibling-count() [functional notation](https://www.w3.org/TR/css-values-4/#functional-notation) represents, as an [<integer>](https://www.w3.org/TR/css-values-4/#integer-value), the total number of child [elements](https://www.w3.org/TR/css-display-3/#elements) in the parent of the element on which the notation is used.

I guess this might be an english language bias, but when people ask "how many siblings do you have?", you usually don't include yourself. 

There might be a reason for this choice (perhaps simply avoiding 0 which is problematic in division and other calculations) but I couldn't find a previous issue about this. I'd personally find it surprising the first time I would use this function, but I could live with it.

Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/12062 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Wednesday, 9 April 2025 08:28:54 UTC