O
O
Outsider V.2019-02-01 14:29:29
Less
Outsider V., 2019-02-01 14:29:29

How to use variable inside nth selector?

There are many nth selectors with one value, I want to set it to a variable, for example:
instead of this:

&:nth-child(-n+4) {
            
          }

This:
&:nth-child(-n+@items) {
            
          }

But no matter how I write this variable, everything writes a syntax error. How to use a variable in such selectors?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
W
WapSter, 2019-02-01
@Audiophile

&:nth-child(-n+@{items}) {
            
}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question