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) Variables, Mixins, and Extending Selectors Introducing Mixins

Tyrone Sunde
PLUS
Tyrone Sunde
Courses Plus Student 6,379 Points

Underneath your mixin definition, specify that all <a> tags should include the mixin.

Do you know what I am doing incorrectly? Below is my code for the above task.

/* Write your SCSS code below. */
@mixin button {color-background:#369;
color:white;}
a {@include button;}

3 Answers

Your mixin is not correct and not sure why it allowed you to pass question one but the code should be as follows.

@mixin button () {
    background: #369;
        color: white;
} 

a {
    @include button;
}

Hampton Catlin any idea why Q1 passes with incorrect syntax

This is quite weird. I had issues with this passing but noted in your solution you included the argument ( ) after button. I did some googling on SASS mixins and as best as I can tell I can't see that this example would absolutely need ( ) after it. As soon as I used ( ) it worked.

Sounds like this might be a bug. Might bring it to the attention of the devs at Treehouse. If I'm wrong i'm wrong, but if it's a bug that can be squashed, lets squash it good.

Laura Hill
Laura Hill
13,674 Points

I believe I have the correct code but its failing. I have exactly what the "best answer" code shows. I did dont have the parentheses, but added them after reading this thread - still fail.

```@mixin button () { background: #369; color: white; }

a {

@include: button;

}

Guil Hernandez
STAFF
Guil Hernandez
Treehouse Teacher

Hi @glenburnett,

You're correct. You do not need the ( ) if the mixin has no arguments. I did, however, try the code challenge just now without the parenthesis and it passed.

Can you please paste the code you wrote in the code challenge so I can take a look? Thanks!

Hi Guil

I don't have a copy of the original code before I moved on to the next challenge (note to self, take screen shots Glen!) however I did go back to the challenge and re-do it.

And now it passess. I have no idea what gives, its looking like user error on my part? (how embarrassing!) Either way good news I guess is that this means no nasty bug to squash and its all a-ok

I do appreciate you taking the time to have a look at it

P.S sorry for not getting back to you guys sooner, the time differences between the States and Australia are almost at opposites (your mornings waking up versus my nights dreaming of rails and css code in my sleep)