Lessphp does not form borders correctly?

I just spent the last few hours trying to figure out why I am getting useless errors, only to find out that my variables are not being imported, because he did not expect the include path to be the current directory (odd ...), so I'm a little exhausted and hope someone else can help me here.

I use this PHP LESS compiler and it works great for just about anything. The following lines simply do not like it:

border: 1px solid (@col-border / 3); 

In this case, @col-border is defined as #996633 . It correctly calculates it as #332211 , but the resulting "CSS":

 border: 1px solid(#332211); 

Which, of course, does not work. Interestingly, this problem does not have the same connection with other lines like this:

 box-shadow: 2px 2px 4px (@col-shadow / 3 * 4), -2px -2px 4px (@col-shadow / 3); /* this compiles just fine */ 

I would really appreciate it if someone could look through it and find out where this problem came from. I'm just too exhausted to dig myself now ...

+4
source share
2 answers

Ok, I figured it out.

Apparently he was reading 1px solid (@col-border / 3); as if solid was the name of the function and @col-border / 3 its argument.

I edited line 2985 to disable the $eatWhitespace $this->match argument, and now it matches spaces after the keyword. Of course, this means that I can no longer use the function (argument) syntax, but has anyone ever used this?

In any case, thanks for not letting me down !: P

+2
source

A solution that does not require editing a line of code

I just thought I was proposing a solution that does not require editing a line of the code itself. It works:

 @col-border: #996633; border: ~"1px solid"(@col-border / 3); 

Outputs:

 border: 1px solid #332211; 
0
source

All Articles