Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

CSS Sass Basics (retired) Advanced Sass Concepts Interpolating and if/else

Sarah Park
Sarah Park
1,857 Points

Console errors on different type of quotes

I get an error with:

background-image: url('#{$color}.png');

Because the console doesn't accept single quotes in this challenge (and replacing the single quotes with double corrects the error).

(I know this isn't really a discussion, but rather a bug report – is there another place where I could report any potential bugs?)

James Barnett
James Barnett
39,199 Points

> is there another place where I could report any potential bugs

Email them to help@teamtreehouse.com

2 Answers

James Barnett
James Barnett
39,199 Points

I think you are right, that is this an issue with in the code challenge correctness check.

When I put in this Sass into codepen

@mixin cars ($color){ background-image: url('#{$color}.png'); }
.myClass { @include cars(blue); }

I get this CSS:

.myClass { background-image: url("blue.png"); }

Since both Codepen & SassMeister compile the Sass into valid CSS, I'd say code challenge engine is being overly strict here.

demo: http://codepen.io/jamesbarnett/pen/jFynJ/?editors=010

tip: In codepen you can click the eye to see a "compile preview" for preprocessors.

I think it's just how that string interpolation (#{}) works as I noticed in Rails it doesn't work with single quotes. So I don't actually think its a bug

James Barnett
James Barnett
39,199 Points

> I think it's just how that string interpolation

I don't think so, see my post.

You are correct it must be an error in the code engine. Are you going to fire off an email to TTH or me or the OP?

Sarah Park
Sarah Park
1,857 Points

I'll send an email – thanks for the quick responses!