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

Samuel Cleophas
Samuel Cleophas
12,348 Points

The Mixin Function is causing Sass to throw an error to the console...

Here is my @mixin function.

// Breakpoints map
$breakpoints: (
  'xs': 575px,
  's': 576px,
  'm': 768p,
  'l': 992px,
);

// Created mixin that leverages the breakpoints map.
@mixin mq($break) {
Ā 
  $value: map-get($breakpoints, $break);
  $s: map-get($breakpoints, 's');

  @if ( $value < $s ) {
      @media screen and (max-width: $value) {
        @content;
    }
  }
  @else {
      @media screen and (min-width: $value) {
        @content;
    }
  }
}

For some odd reason, the console throws this error regarding the line where I've declared the local '$value' variable:

Invalid CSS after "points,  $break)": expected "{", was ";"

This makes no sense yo.