You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
above($value, $width = true)
$value = rem($value)
if $width == true
media = '(min-width: %s)' % $value
else
media = '(min-height: %s)' % $value
@media media
{block}
The function rem() is for transform to rem the numbers set in pixels:
rem($value)
return unit($value/16, 'rem')
Also I have others mixins for max-width and the operator 'and':
below($value, $width = true)
$value = rem($value)
if $width == true
media = '(max-width: %s)' % $value
else
media = '(max-height: %s)' % $value
@media media
{block}
between($minValue, $maxValue, $width = true)
$minValue = rem($minValue)
$maxValue = rem($maxValue)
if $width == true
from = '(min-width: %s)' % $minValue
to = '(max-width: %s)' % $maxValue
media = from + ' and ' + to
else
from = '(min-height: %s)' % $minValue
to = '(max-height: %s)' % $maxValue
media = from + ' and ' + to
@media media
{block}
So, now there is the new syntax for media queries that let you use operators <,> and = to set ranges. I would like to convert this mixins to the new syntax doing this:
above($value, $width = true)
$value = rem($value)
if $width == true
media = '(width >= %s)' % $value
else
media = '(height >= %s)' % $value
@media media
{block}
The problem is that this returns an error: illegal unary ">=", missing left-hand operand.
So, is there any way to solve this, maybe escaping the operator or something like that?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I have this mixin that compiles without problem:
The function rem() is for transform to rem the numbers set in pixels:
Also I have others mixins for max-width and the operator 'and':
So, now there is the new syntax for media queries that let you use operators <,> and = to set ranges. I would like to convert this mixins to the new syntax doing this:
The problem is that this returns an error:
illegal unary ">=", missing left-hand operand
.So, is there any way to solve this, maybe escaping the operator or something like that?
Thanks.
Beta Was this translation helpful? Give feedback.
All reactions