Skip to content

Less Language Variable as Media Query

Mária Jurčovičová edited this page Dec 26, 2013 · 5 revisions

Media query can be placed into a variable and reused on multiple places.

Sample input:

@singleQuery: ~"(max-width: 500px)";
@media screen, @singleQuery {
  set {
    padding: 3 3 3 3;
  }
}

compiles into:

@media screen, (max-width: 500px) {
  set {
    padding: 3 3 3 3;
  }
}