Re: [css-values] CSS counters inside CALC function

On Fri, Aug 26, 2016 at 4:29 AM, Hr Gwea <> wrote:
> Have you, guys, thought of the possibility of using CSS counters inside the
> CALC function?
> That would be super useful for so many cases.

The current counter() function outputs a <string>, so it can't be used
directly in calc(). We could possibly define a counter-value()
function that gave an integer, of course.

However, all of the uses I've ever seen for this have been pretty
trivial "toy" cases.  The closest thing to reasonable I've ever seen
has been clock use-cases, like your example seems to be, and those are
rare enough that they're not very strong justification for this
feature.  Counters are surprisingly expensive in browsers, and so
they're loathe to add new features that would promote heavier usage of
them without strong justification.


Received on Tuesday, 30 August 2016 21:56:09 UTC