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 Add Reusable Logic to Your Sass Storing Values in Maps

Help with media queries

@mixin mq($break) {
   @if $break == 'xs' {
     @media (max-width: $break-xs) {
       @content;
     }
   } 
   @else if $break == 'sm' {
     @media (min-width: $break-s) {
       @content; 
   }
  }
  @else if $break == 'med' {
     @media (min-width: $break-m) {
       @content;    
   }     
  }
  @else if $break == 'lg' {
     @media (min-width: $break-l) {
       @content; 
    }
  }
 }

It says error:

undefined variable: "$break-m"
on line 60 of scss/utilities/_mixins.scss, in 'mq' 
from line 8 of scss/layout/_containers.scss
from line 16 of scss/style.scss

1 Answer

Rich Donnellan
MOD
Rich Donnellan
Treehouse Moderator 27,696 Points

Where are you declaring your $break-{} variables? Is $break-m spelled correctly and defined? It can't find a reference indicating there is some issue where this code is located.