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 Improve Your Workflow with Sass Write a Mixin

blake littleton
blake littleton
14,255 Points

Passing color values?

I'm having trouble with the last part of this code challenge ..I'm stuck , I put it the color value inside the button rule. I tried the @include rule to but it did not work. Any suggestions?

style.scss
$btn-background: #dc143c;

/* Write your SCSS code below. */
@mixin button{
font-size:1.25em;
background-color:$btn-background;
@content;
$colorvalue:#f0f8ff;
}

a{
font-size:1.25em;
background-color:$btn-background;
}

1 Answer

Jason Anders
MOD
Jason Anders
Treehouse Moderator 145,692 Points

Hey Blake,

You just got a bit off track, but also I think the code checker passing Task 2 for you when it shouldn't have may be leading to some of you confusion.

Task 2 asks you to include the button mixin for the <a> tags, but you have the rules hard-coded instead of using @include, which the challenge should have given a "Bummer!" instead of passing (Tagging Guil Hernandez to have a look at Task #2).

So, then in Task 4, the instructions say to add the color rule to the "button include" for the <a> tags. Here you just want to do

color: #f0f8ff;

which would go after the @include. Instead, you are creating a variable to hold a color value. So, that needs to be changed, and the actual rule needs to be moved out of the mixin and into the <a> tag rules.

I hope this helps. :)

Keep Coding! :dizzy: