Re: [csswg-drafts] [css-values] enable the use of counter() inside calc() (#1026)

> Another use case here:
> 
> ```css
> .item:nth-of-type(n) {
>   transform: rotate(calc(n*10deg)); /* 10 comes from 360/totalItemsCount */
> }
> ```

Could you elaborate a bit on this? `n` cannot be used in `calc()`, and it's unclear what it would mean if it could. `:nth-of-type(n)` matches everything, so you could remove that pseudo-class entirely with the same result.
If what you need access to is the total count of items, `counter-value()` could not help here, as it would be different on each item.
Could you also elaborate on *why* you are dividing `360deg` by the total number of items? Are you placing them around a circle of something? A screenshot of a sample rendering would help a lot here!

-- 
GitHub Notification of comment by LeaVerou
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/1026#issuecomment-997846509 using your GitHub account


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

Received on Monday, 20 December 2021 11:36:58 UTC