These are chat archives for less/less.js

22nd
May 2015
Andrea Coiutti
@ACXgit
May 22 2015 14:42

Hi everybody, I'm getting crazy with this problem: I'm trying to define a variable for a media query for responsive behaviour

// everything between 992px and 1200px
@view-md: ~'(min-width: @screen-md-min) and (max-width: @screen-lg-max)';

and then trying to use in this way:

@media @view-md {
    display: none;
 }
isn't this supposed to work?
I'm using grunt-contrib-less to compile
is it because I'm calling other variables inside the quotes?
Kristjan Broder Lund
@MiniGod
May 22 2015 14:45
What is the css output?
Andrea Coiutti
@ACXgit
May 22 2015 14:47
no mention of that output in the resulting css
like it was ignored
ok mystery solved :)
// everything between 992px and 1200px
@view-md: ~'(min-width: @{screen-md-min}) and (max-width: @{screen-lg-max})';
this is the right way to call the variables inside the escape
Kristjan Broder Lund
@MiniGod
May 22 2015 14:50
:thumbsup: good that you figured it out your self :)
Andrea Coiutti
@ACXgit
May 22 2015 14:50
hope it could be useful for somebody else :D