mappy-breakpoints icon indicating copy to clipboard operation
mappy-breakpoints copied to clipboard

Incompatible units error

Open Crustan opened this issue 7 years ago • 2 comments

Hi!

Im using mappy-breakpoints (v. 0.2.3) like this:

$breakpoints: (
  's' : 36em,
  'm' : 48em, 
  'l' : 64em,  
);

@include mappy-bp(s m){
  //Doing some styles
};

But I get this error:

sass\1-vendor\_mappy-breakpoints.scss
Error: Incompatible units: 'px' and 'em'.
        on line 129 of sass/1-vendor/_mappy-breakpoints.scss
>>     $_maxw: mappy-convert-to-em($_maxw - 1px);

EDIT: Got it to work after changing $_maxw: mappy-convert-to-em($_maxw - 1px); to $_maxw: mappy-convert-to-em($_maxw - mappy-em(1px));

Crustan avatar Aug 23 '17 11:08 Crustan

Interesting error. Let me get to it when I find some time on my hands.

zellwk avatar Aug 28 '17 09:08 zellwk

Encountered the issue again, I made a PR to allow more general units:

https://github.com/zellwk/mappy-breakpoints/pull/28

X-Y avatar Jan 02 '23 10:01 X-Y