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 CSS to Sass Refactoring with Sass Reusing Code with Mixins

Jimmy Names
Jimmy Names
10,371 Points

Why doesn't he declare #{$file} in +variables.scss ? How does the path know..

?

1 Answer

Tobias Helmrich
Tobias Helmrich
31,602 Points

Hey Jimmy,

he doesn't declare it because it will change with every font. That's why he declares it dynamically when he uses the mixin. When the mixin is used Guil gives it the file name as the second parameter.

@include font-face('Abolition Regular', abolition-regular);

In this case the second parameter $file is abolition-regular. When the mixin is now executed it will insert abolition-regular.