Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
argyleink opened this issue Nov 6, 2023 · 1 comment

Comments

@argyleink
Copy link
Contributor

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, but when needed they can specify resolution against the light dom.

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 😅

@nt1m
Copy link
Member

nt1m commented Nov 8, 2023

I don't think we typically expose the tree used to CSS

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants