Post
Maybe off-topic but looking at nerdy.dev/hover-not-ho..., it would be nice to be able to assign ‘n’ to a custom prop when doing ‘:nth-child(n)’. Would somewhat mitigate the need for looping.
nerdy.dev:hover > :not(:hover), sorry not sorry · January 6, 2025Focus by demotion.
i believe what you're describing is sibling-index(), a function specced to return each elements individual index. this would remove the inline custom properties and become more dynamic, moving it towards your suggestion here yeah? github.com/w3c/csswg-dr...
github.com[css-values] Proposal: add sibling-count() and sibling-index() · Issue #4559 · w3c/csswg-draftsProblem Currently we can query a child based on it's child index position or query on children length (with some complex syntax), but we can't use the index or length as values in our styles. Feels...
1 repost5 likes