Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trial
Chris Scott
7,673 PointsAdvanced SASS Concepts > Interpolation Challenge 4/4 > Bummer! rgb(0, 0, 238)
Underneath the previous code, store the value "morning" in a variable named "$time". Then write an if/else directive that will color all "a" tags. If the variable $time is equal to "morning," the color should be red. Else, if the variable is "afternoon", the color should be blue. Finally, if the variable is set to anything else, the color should be gray.
Error: Bummer! rgb(0, 0, 238)
$time: morning;
@if $time == morning { a { color: red; } }
@else if $time == afternoon { a { color: blue; } }
@else { a { color: gray; } }
Double checked and it compiles correctly with no issues in my IDE.
Wendell Pulsipher
10,183 PointsHampton Catlin I am confused about this as well... can you help please? my code looks like this
Guil Hernandez
Treehouse TeacherLooks like your code didn't post correctly. Take a look at the markdown cheatsheet for instructions on how to post code on the forum.
Wendell Pulsipher
10,183 PointsOoops.. That's okay. Right after I had posted this comment my browser decided to finish loading the rest of the comments below where I found my problem. Thanks anyways :D
10 Answers
Guil Hernandez
Treehouse TeacherChris Scott - You're super close. If you nest your if/else statements inside a { ... }, you should be good-to-go. It's all about DRY-ness. :)
Nachiket Kumar
3,590 PointsI'm having the same issues, I'm getting an error saying: Bummer! The color should be set to red. My code is:
$time: morning
a {
@if $time == morning {
color: red;
}
@else if $time == afternoon {
color: blue;
}
@else {
color: gray;
}
}
Unsubscribed User
Courses Plus Student 8,511 PointsHas this issue been resolved yet? I am also, getting the same error and I know that the code is right.
coryshipko
3,869 PointsRiley Penna You've probably figured it out already, but for future people: If you post if/else block outside of the @mixin by itself, then it passes the code challenge successfully.
Kevin Korte
28,149 PointsI come up with the same results as you, and also received the same error. Must be an issue with the server, as I don't see what's wrong. Even double checked the syntax with the video.
Chris Scott
7,673 PointsThe Error is also present when no values are passed to the IF/ELSE
$time: morning;
@if $time == morning { }
@else if $time == afternoon { }
@else { }
Hampton Catlin
Treehouse Guest TeacherWhat version of Sass are you using? You can find this out by typing in sass --version
I tried the above code on Sassmeister.com with 3.3.0rc1 and it works just fine. Check out the gist here: [http://sassmeister.com/gist/7685096]
Chris Scott
7,673 PointsIt compiles fine in my IDE but not on the Code Challenge.
Hampton Catlin
Treehouse Guest TeacherOh! I didn't actually build the Sass compiler into the Code Challenge module. This is something that sounds like a bug in the code challenge itself. Sorry, I misunderstood!
Let me notify support!
Nachiket Kumar
3,590 PointsNever mind- silly error. I'll let you figure it out from my code above....there's a missing ; :(
Unsubscribed User
Courses Plus Student 8,511 PointsHas this issue been resolved yet? I am also, getting the same error and I know that the code is right.
James Barnett
39,199 PointsJames Barnett
39,199 PointsTagging Hampton Catlin to get a hint on this one.