D
D
Denis2015-10-24 18:23:28
css
Denis, 2015-10-24 18:23:28

How to solve undefined variable problem in LESS?

The Koala compiler outputs an error message: variable @pageWidth is undefined.
The bottom line is this: there is a list with LESS included files:

@import "grid-settings.less";
@import "variables.less";

these files are included in the site.less file. This file has a rule:
min-width: @pageWidth;
where @pageWidth is defined in the file @import "grid-settings.less"in the media query:
@lg-min: 			1170px;

@media only screen and (min-width: 1170px) {
  @pageWidth: @lg-min;

  @colWidth: @col-lg;
  @gutter: @gutter-lg; 


  .make-grid(lg);
  .make-offsets(lg);
}

so what's the problem then? why is the variable not visible if it is defined in the included file? Help deal with the problem.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dmitry Sergeevich, 2015-10-24
@CheckOneTwo

The SASS docs say that this construction will not work in media queries. Just read it yesterday. sass-guidelin.es/ru

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question