Freecodecamp: [BETA] - Front End Libraries - Sass - Apply a Style Until a Condition is Met with @while

Created on 20 May 2018  Â·  27Comments  Â·  Source: freeCodeCamp/freeCodeCamp

Describe your problem and - if possible - how to reproduce it

Challenge passes for all .text classes except text-1 , while the font-size is correctly changed for text-1 in the HTML page. Here is my solution code:

  $x: 1;
  @while $x < 11 {
    .text-#{$x} { font-size: #{5*$x}px;}
    $x: $x + 1;
  }

Add a Link to the page with the problem

https://learn.freecodecamp.org/front-end-libraries/sass/apply-a-style-until-a-condition-is-met-with-while

Tell us about your browser and operating system

  • Browser Name: Chrome
  • Browser Version: 66.0.3359.181 (Official Build) (64-bit)
  • Operating System: Windows 10

If possible, add a screenshot here

screenshot 27

resolveshipping

Most helpful comment

Having the same problem. Even tried setting .text-1 manually after the loop to no luck.
screenshot 2018-06-06 09 49 31

All 27 comments

Well I used font-size: 5px*$x;
Which worked fine..

That still does not pass for the .text-1 class, at least for me, could you post your entire code?

here is the source code

<style type='text/sass'>
  $x:1;
  @while $x<13{
  .text-#{$x} {font-size:5px*$x;}
  $x:$x+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>
<p class="text-6">Hello</p>
<p class="text-7">Hello</p>
<p class="text-8">Hello</p>
<p class="text-9">Hello</p>
<p class="text-10">Hello</p>

Quick Tips

Place you cursor somewhere in the SAAS code & press Ctrl+Enter
Otherwise it is not working.

here is the screenshot
image

Still no go for me after trying your code

I noticed this too. @rajatkantinandi's code is correct, but I had to submit it multiple times to pass all the checks. It also seems like all styling is dropped when the tests are run, leading to the default font-size, then Sass is recompiled and displayed. I'm thinking that the tests are firing and failing sometime during that process.

@scissorsneedfoodtoo
Maybe you are right because at least I had to submit twice to pass the test.

I'm closing this issue as stale since it hasn't been active lately. If you think this is still relevant to the newly updated platform, please explain why, then reopen it.

Having the same problem. Even tried setting .text-1 manually after the loop to no luck.
screenshot 2018-06-06 09 49 31

The issue is still ongoing. As suggested on this post on the FCC forum, I tried on different browsers, without luck.

Chrome:

1

Firefox:

screenshot from 2018-06-27 20-58-33

This seems to work though...

workssss

@dCremins @kamatheuska Thanks for reporting that this is still a problem. I've reopened the issue and given it the "help wanted" label.

This is also tracked in #12699

try run test multiple times or try in another browser. that works for me

Was not able to get it to pass until I tried the CTRL+Enter as suggested above. Since I haven't had to do that for any other test it was extremely frustrating.

To synthesise a few responses for people who are still feeling stuck (based on my experience):

In Chrome it did not work, even if I pressed Ctrl-Enter
In Firefox it did not work with the button, but pressing Ctrl-Enter did work

Chrome: Version 68.0.3440.106 (Official Build) (64-bit)
Firefox: 61.0.2 (64-bit)

write :
$x:1;
@while $x<11{
.text-#{$x} {font-size:5px*$x;}
$x:$x+1;
}

and... it's good !

Guys I'm not sure what the problem is since I'm not able to replicate it, can someone elaborate ?

Read the linked bug if you are interested in the details.

In production, tests begin before the compilation of the sass code is complete. It's resolved in the master branch.

The issue has been fixed this can be closed.

cc: @ezioda004

Fixed in master, closing.

hi i am still having this issue

The issue is still happening, I don't think it's fixed

Screenshot from 2019-06-21 03-32-21

Yes, because the fixes haven’t been pushed to production

still not fixed

still not fixed

Today still not fixed in Chrome.
In Firefox is working.

Actually, if you are looking for certificates no need to complete this..but
its completely based on project

Thanks & Regards
Abidh K Muhammed

On Sat, 17 Aug 2019 at 02:59, Kamil Wyremski notifications@github.com
wrote:

Today still not fixed in Chrome.
In Firefox is working.

—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
https://github.com/freeCodeCamp/freeCodeCamp/issues/17195?email_source=notifications&email_token=AFKVAN564RRV4OOOASYUFL3QE4WNZA5CNFSM4FAYOYV2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD4P4BBQ#issuecomment-522174598,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AFKVANZMJFSHB6EBKA3TDIDQE4WNZANCNFSM4FAYOYVQ
.

Was this page helpful?
0 / 5 - 0 ratings