-
Notifications
You must be signed in to change notification settings - Fork 677
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] Extend sibling-index() and sibling-count() with a selector argument #9572
Comments
Thought about this a couple of times as well. Really like this approach, looks like it covers all edge cases or at least provides a got solution to work around these. |
This is something I'd really want to have, and I encountered a few places where it could be very helpful while working on my latest article.
I think this is something that should be decided generally for any selectors as values, and I'll copy my comment from there:
|
I guess the shadow DOM question applies regardless of this issue. |
https://drafts.csswg.org/css-values-5/#tree-counting
So
sibling-count(<selector>)
would count the number of inclusive siblings that match the selector.And
sibling-index(<selector>)
would provide the index of the element among its inclusive siblings that match the selector. If the element doesn't match the selector, I guess this could be zero? Or maybe become invalid at computed-value time or something.The text was updated successfully, but these errors were encountered: