Sass: Apply a Style Until a Condition is Met with @while 9/22

Massive Problems :grinning:

I have used two different variations of Sass Code for this lesson:

<style type='text/sass'>

    $index: 1;
  @while $index < 6 {
    .text-#{$index} { font-size: 15 * $index}
    $index: $index + 1;
  }
  
  
</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>

<style type='text/scss'>
  $x:1;
  @while $x<11{
.text-#{$x} {font-size:5px*$x;}
  $x:$x+1;
  }
  
  
</style>

<p class="text-1" style="font-size: 5px;">Hello</p>
<p class="text-2" style="font-size: 10px;">Hello</p>
<p class="text-3" style="font-size: 15px;">Hello</p>
<p class="text-4" style="font-size: 20px;">Hello</p>
<p class="text-5" style="font-size: 25px;">Hello</p>
<p class="text-6" style="font-size: 30px;">Hello</p>
<p class="text-7" style="font-size: 35px;">Hello</p>
<p class="text-8" style="font-size: 40px;">Hello</p>
<p class="text-9" style="font-size: 45px;">Hello</p>
<p class="text-10" style="font-size: 50px;">Hello</p>

Do you have a question?

Sass again, It will not pass?

You are multiplying by 5, not 15.

$index: 1;
  @while $index < 6 {
    .text-#{$index} { font-size: 15 * $index}
    $index: $index + 1;
  }

That code passes the tests. Are you still having problems?

Yes, I think it’s a Bug or a Browser issue, I’m using firefox and Chrome, I’m going to use Edge and see what happens

Have you changed any other part of the code? It passes fine for me on Firefox. I suggest resetting the challenge and putting in only the code that you shared in your last reply.

Yes! :grinning: It worked in Edge! Thanks!

Congratulations on solving the challenge. Happy coding!