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

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

Need a little help Clarifying Interpolation

So, I get how to do it, but I don't really get what is going on.

For example:

@for $i from 1 through 100 {
    .box:nth-child(#{$i}) {
        background: darken(white, $i);
    }
}

@each $member in thom, jonny, colin, phil {
    .bandmember.#{$member} {
        background: url("images/#{$member}.jpg");
    }
} 

On the Sass for background: darken, I don't use interpolation and it doesn't compile an error, but if I do use it, it complies an error. But on background: url I don't use interpolation and it spits out background: url("images/$member.jpg"); in the CSS file.

Can anyone help clarify the mechanics of this?