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 Defining Variables

Defining Variables: Why is there no value on some of the numbers? Ex-em, px, etc.

Defining Variables: Why is there no value on some of the numbers? Ex-em, px, etc.

2 Answers

steyoung
steyoung
12,781 Points

There really should be values provided when created variables. Example:

@mixin button ($color, $size) { background: $color; width: $size; height: $size /2; }

@include button(red,25px)

you need to use @include to say you want to use it and you need to pass it values to work with

@mixin creates a variable and then later in your work you'll use @include to give it the values you need. the @mixin can be anything you want which is what makes it so great! Hope this helps.

that in no way answers my ? like the 2 up there. i later learned it's actually a number just being multiplied or divided....