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 trialMelissa L
Front End Web Development Techdegree Student 10,296 PointsMixin media query error: Invalid null operation: "null lt 576px".
Not sure why it is giving this message in the console. The error message is: error scss/utilities/_mixins.scss (Line 48: Invalid null operation: "null lt 576px".).
Any help will be greatly appreciated.
mixins:
@mixin mq($break) {
$value: map-get($breakpoints, $break);
$sm: map-get($breakpoints, 'sm');
@if $value < $sm { /* this is line 48 */
@media (max-width: $value) {
@content;
}
}
@else {
@media (min-width: $value) {
@content;
}
}
}
variables:
$break-xs:575px;
$break-s:576px;
$break-m:768px;
$break-l:992px;
$breakpoints:(
'xs': 575px,
'sm': 576px,
'med': 768px,
'lg': 992px,
);
1 Answer
JASON LEE
17,352 PointsI figured it out from my own problem. It has to do with consistently naming the keys in the variable $breakpoints
.
So in your __variables.scss file, look at the $breakpoints
section and make sure the keys e.g. xs s m l
are labeled and applied consistently throughout the entire project and all the folders files. For instance s
vs sm
or m
vs md
vs med
.
// Breakpoints
$break-xs: 575px;
$break-s: 576px;
$break-m: 768px;
$break-l: 992px;
$breakpoints: (
'xs': 575px,
's': 576px,
'm': 768px,
'l': 992px,
);
// Media queries
@mixin mq($break) {
$value: map-get($breakpoints, $break);
$sm: map-get($breakpoints, 's');
JASON LEE
17,352 PointsJASON LEE
17,352 PointsI'm getting the exact same error message as well...