Need assistance in Use for to Create a Sass Loop


#1

Challenge Name

Use for to Create a Sass Loop has an issue.

Issue Description

Browser Information

User Agent is: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:54.0) Gecko/20100101 Firefox/54.0.

Also tested it on my Chrome Browser as well, same problem

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/59.0.3071.115 Safari/537.36.

Screenshot

Your Code



<style>
  @for $j from 1 to 6 {
    .text-#{$j} {font-size: 10px * $j}
  }
</style>

<p class="text-1">Hello</p>
<p class="text-2">Hello</p>
<p class="text-3">Hello</p>
<p class="text-4">Hello</p>
<p class="text-5">Hello</p>


#2

Hi @Sluthsaber95,

If you look at the documentation about Sass Directives, the @for loop works with through and not to:

@for $i from 1 through 6 {
  [...]
}

Best regards,
Anthodpnt