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

What's wrong with my code?

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

$font-url--google : 'http://fonts.googleapis.com/css?family=Lato:100,300,400,700,900';

I can't get these code to work, please help.

2 Answers

Chris Shaw
Chris Shaw
26,676 Points

Hi Jeric,

The challenge is only looking for the variable $font-url while you have $font-url--google which is from the video, also just to clarify variable-exists only works if the variable is defined before hand.

$font-url--google: 'http://fonts.googleapis.com/css?family=Lato:100,300,400,700,900';

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

Ah, thank you very much, :D