I may be misunderstanding how .less files are included and compiled with this module. I have a template which uses .less files, and a module which uses .less files. I'd like the module's .less files to be able to use variables which are defined in the template's .less files. Right now, I get an error "LESS error: variable @variable-name is undefined."
I am using Drupal 7.50, and using the Drupal Bootstrap theme. I have made a sub-theme, installed the Bootstrap library 3.3.7. I have modified my sub-theme's .info file so it includes the top-level .less file of the sub-theme:
stylesheets[all][] = less/style.less
This has been working and it appears all the imported sheets are included.
To now have a custom module include its own .less stylesheet, in the module's .info file:
stylesheets[all][] = modulename.less
In this case, the less code in this sheet references various bootstrap variables, such as @screen-sm-min, and I get the error:
LESS error: variable @screen-sm-min is undefined in file modulename.less in modulename.less on line 7, column 22 05| padding: 20px 5px 5px 20px; 06| 07| @media (min-width: @screen-sm-min) { 08| min-height: 155px; 09| } 10| , modulename.less
Comments