Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

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 25,764 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.