[csswg-drafts] [css-values-5] allow specifying flat vs light tree in `sibling-index()` and `sibling-count()` (#9562)

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

== [css-values-5] allow specifying flat vs light tree in `sibling-index()` and `sibling-count()` ==
In a goal to allow author flexibility with `sibling-index()` and `sibling-count()` and the value resolution from the flat tree vs the light tree, I propose adding a parameter to the functions so developers may specify which tree they need. This would allow developers to work with happy path [default flat tree default behavior](https://github.com/w3c/csswg-drafts/blob/762eacee436fdcb1b11e7e482e6cdb3fee161317/css-values-5/Overview.bs#L1432), but when needed they can specify resolution against the light dom.

```css
ul {
  li {
    animation-duration: calc(sibling-index() * 50ms);
  }
}

:host {
  li {
    animation-duration: calc(sibling-index(light-tree) * 50ms);
  }
}
```

Trade offs: 
- it would disrupt the potential for `of <<selector>>` syntax to be used between the parenthesis
- it would depart from the alignment with `nth-child()`

Use cases:
I don't really have any example use cases for wanting light tree, but the fact there are two trees to resolve against makes me think eventually someone will show up with a use case 😅 

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


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

Received on Monday, 6 November 2023 20:25:36 UTC