J
J
jeruthadam2019-07-22 18:47:35
css
jeruthadam, 2019-07-22 18:47:35

How to generate SCSS variables?

SCSS allows you to generate classes in a loop. How to generate variables?

$base-rem: 20;

@for $px from 1 through 40 {
  $px#{$px}: #{$px / $base-rem}rem;
}

Does not work!
Need variables like
$px40: #{40 / $base-rem}rem;

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Anatoly Kulikov, 2019-07-22
@jeruthadam

To be honest, I have never heard of scss generating variables for its use.
All the "magic" of scss happens when css is generated - there the program goes through the file and processes the code accordingly.
I can advise you to try to generate the desired code in any programming language and paste it.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question