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 trialJordan Saxe
4,713 PointsMixins Issue
I keep getting an error when trying to submit this on the SASS code challenge. It says that there is an error and the background color is not correct.
@mixin button { background: { color: #369; } color: white; } }
a { @include button; }
2 Answers
Giovanni CELESTE
20,961 PointsHi Jordan, in fact, your code was wrong from the first of 2 steps of the code challenge. You have an odd (and maybe too much) curly bracket in your mixin.
@mixin button {
{background: #369 ;} // you don't need brackets here, but doesn't count much
color: white ;} // this one would close you mixin
} // this one is a spare closing curly bracket
a {
@include button ;
}
What I would write
@mixin button {
background: #369 ;
color: white ;
}
a {
@include button ;
}
James Barnett
39,199 PointsRemember brackets in Sass work just like brackets in CSS.
P.S. - Remember as Hampton Catlin taught us ... it's Sass is a word not an acronym. Because remember only you can prevent over-capitalization .