- From: Tab Atkins Jr. via GitHub <sysbot+gh@w3.org>
- Date: Mon, 05 May 2025 21:26:03 +0000
- To: public-css-archive@w3.org
It's self-including because the use-cases for it all involve the total child counts. Almost any example that wants to style something based on how many children are in an element wants to know the *total number*, like `calc(100% / sibling-count())` or something. Counting the number of children *excluding the element itself* is a much more niche use, and in the rare cases it *is* what you want, can be done with a simple `- 1` in the `calc()`. I understand that the name `sibling-count()` somewhat leans toward the "excluding the element itself" meaning, but there's no better English word to use. We originally thought to name these functions similar to the selector functions, but "children" was more confusing, since it implied counting or indexing the *element's* children, not the set of children the element was part of. We switched to "sibling" for clarity, knowing this sort of confusion was possible, and judged it worthwhile. (Even in English, it's a little ambiguous - if you're asked "how many siblings do you have?" I sometimes say "there's 3 of us, me and my two brothers", because people are usually *actually* wanting to ask how many children my parents have, but are talking to me and so are compelled to phrase the question with me as the subject.) -- GitHub Notification of comment by tabatkins Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/12062#issuecomment-2852375962 using your GitHub account -- Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config
Received on Monday, 5 May 2025 21:26:04 UTC