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 trialJulian Tung
6,282 PointsAdvanced Sass Interpolating and If/Else
Hi there, first time posting on the forums so forgive me if I make any formatting mistakes etc.
I am currently having trouble with Challenge task 2/4 for this section:
The mixin should use the value in "$make" as the name of a new class. The class should have a 1px solid black border.
Here is what I have so far -
@mixin cars($make, $color) { }
I am assuming I've already made a mistake starting off like this as there is no interpolation currently (.#)
6 Answers
Yichang Liu
4,688 Pointsthe class should be: .#{$make}
@mixin cars($make, $color){
.#{$make}{
border: 1px solid black;
}
}
peterdemain
8,001 Points@mixin cars($make, $color){ .#{$make}{ border: 1px solid black; .append {background-image:url("#{$color}.png");} } }
the next bit ;)
Julian Tung
6,282 PointsThank you for your help Yichang, worked perfect!
peterdemain
8,001 Points@mixin cars($make, $color){ .#{$make}{ border: 1px solid black; .append {background-image:url("#{$color}.png");} } }
the next bit ;)
Isaac Kingsley Abban Kwofie
8,492 Points@mixin cars ($make , $color){ .#{$make} { border: 1px solid black; } }
Isaac Kingsley Abban Kwofie
8,492 Points@mixin cars ($make ,$color){ .#{$make} { border: 1px solid black; .append { background-image: url("images/.#{$color}.png")} } }