Can't fix Can't use relative colors in LESS

Kirby

Well-known member
Affected version
2.3.2
The following CSS causes errors when used in LESS templates.

Code:
--color-red: hsl(0, 100%, 50%);
--color-red-alpha: hsl(from var(--color-red) h s l / 0.5);

Code:
ArgumentCountError: Too few arguments to function Less_Functions::hsl(), 1 passed in <redacted>/src/vendor/oyejorge/less.php/lib/Less/Tree/Call.php on line 76 and exactly 3 expected
 
Sadly, this is something we aren't currently able to fix.

Less.php is not feature complete with Less.js. My understanding is this syntax was added somewhere around Less.js 4.0. I think Less.php aims to be roughly feature complete up to version 3.13 (although depending on a few factors, I suspect our current build of Less.php only goes up to Less.js 2.5).

We are continually monitoring its development as there are other features we would like to use in the future that also aren't currently present.
 
Ah yes, good shout. This will escape the syntax and rely on the browser's CSS support for handling it.
 
Back
Top Bottom