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 Modular CSS with Sass Getting Modular with Mixins and Functions Sass Function Challenge

Routine Poutine
Routine Poutine
26,050 Points

Why is $font-url undefined when this is the variable the variable-exists introspection function is looking for?

Hi,

May I have a hint as to why:

@if variable-exists($font-url) { @import url($font-url); }

cannot find a defined variable in this quiz?

Best,

Matt

style.scss
@if variable-exists($font-url) {
 @import url("$font-url");
} 
Routine Poutine
Routine Poutine
26,050 Points

@if variable-exists($font-url) { @import url($font-url); }

does not work either.

1 Answer

If the previous video @ 1:11 is an indication the variable has no dollar sign in the variable-exists function and no quotes inside url

@if variable-exists(font-url) {
 @import url($font-url);
}