I am working on lessphp compiler for my own development needs, here is what I am trying to achieve.
a) I have parent theme and child theme both have less files.
b) Using twitter bootstrap less files
c) Parent theme have twitter bootstrap less files
d) I am trying to use less files from parent theme in my child theme less file by using @import
I have tried:
a) Passing paths as php variables by using lessphp setVariables(), and it gives me something like this.
i) @import “E:wamppersonalmultisite/wp-content/themes/my-theme/bootstrap/variables.less”;
ii) @import “E:wamppersonalmultisite/wp-content/themes/my-theme/bootstrap/mixins.less”;
code used:
@import "@{template_directory_path}/bootstrap/mixins.less";
@import "@{template_directory_path}/bootstrap/variables.less";
but its outputed as is in .css file instead of being imported as less file for parsing.
b) I tried to set directory search paths using lessphp addImportDir(), but it didn’t worked either,
so anybody familiar with my situation, wanna help me out?
The issue is with encoding. The less compiler I was using needs the .less files to be encoded as UTF-8 without BOM. All of my files were encoded as UTF-8 with BOM. Once I changed the encoding the files started compiling as needed.