1

I'm looking to create a series of variables from a for loop in SASS, as opposed to creating selectors, properties or values.

An example of what I am after

$px1:    (1 / 16) + 0em;
$px2:    (2 / 16) + 0em;
$px3:    (3 / 16) + 0em;
$px4:    (4 / 16) + 0em;

This would give me the em values for the equivalent font sizes. I'm new to SASS but coming from LESS I had to list all these vars manually which is quite a ballache. Before I go and do that again, is there a quicker way to generate these dynamically?

Simon Smith
  • 8,024
  • 2
  • 30
  • 40

0 Answers0