#1068: CSS Values and Units: sibling-count() and sibling-index()
Discussions
Log in to see TAG-private discussions.
Discussed
Mar 1, 2025 (See Github)
Xiaocheng: adds two additional functions to CSS... use case is to create styling that depends on ...? One example is radio select menu. You have a list where items are placed like a radio (circular dial).. to create this pattern you need to know sibling index and total number of items so you can calculate rotation angle. Introduction of these functions are to solve these use cases...
First I think the use cases are pretty solid. The solutions are canonical to use cases... Provides the exact pieve of information, which is good. Also if we want to talk about concerns - we are exposing the DOM structure to CSS... they way these functions are defined seem to address these concerns... Defined in a way that are identical to existing CSS counters. Not allowing CSS to directly access DOM structure... But allowing CSS to use a counter value. Overall opinion is "solid use case, good solution, no arch issues," should be closed as satisfied...
Dan: are there any privacy implications to exposing DOM structure in this way?
Xiaocheng: exposing it in the sae way as CSS counters.
Martin: Could do this within element. A real pain, but possible.
Dan: accessibility concerns? We're not really talking about interaction, we're talking about layout. So probably not. Is there any interaction with ARIA?
The explainer seems short, though they have provided one. They haven't included anything on privacy or accessibility, even to say "we don't see any issues".
Martin: I don't see any privacy or accessibility issues here.
Dan: I'm just trying to make sure we are being thorough.
I think it's fine.
Xiaocheng: so we close it as satisfied and suggest that in future we would request that review requests include privacy and accessibilty concerns even if they seem trivially unrelated?
[all: agreed]
Action: Xiaocheng to close as 'satisfied' with the above info.
Comment by @xiaochengh Mar 26, 2025 (See Github)
Hi @lilles, we discussed it at a TAG breakout today and are happy with these two tree-counting functions.
We also recommend that future review requests should include privacy, security and accessibility considerations even if they seem trivially unrelated.
OpenedMar 17, 2025
こんにちは TAG-さん!
I'm requesting a TAG review of CSS Values and Units: sibling-count() and sibling-index().
The CSS Values and Units Module Level 5 introduces tree counting functions, specifically
sibling-index()
andsibling-count()
. These functions can be used as<integer>
values directly or combined with other values in calc() expressions. Thesibling-index()
andsibling-count()
functions evaluate to integers at computed value time based on the flat tree position of the element.Further details:
You should also know that there are open issues to extend tree-counting functions: