less / less.js

Less. The dynamic stylesheet language.
http://lesscss.org
Apache License 2.0
17k stars 3.41k forks source link

cannot use css var in function hsvhue #3612

Closed quanzhiyuan closed 3 years ago

quanzhiyuan commented 3 years ago

@theme-color: var(--theme-color, #5582F3); @hsv-h: hsvhue(@theme-color);

it has the error error evaluating function hsvhue: Argument cannot be evaluated to a color

see here https://codepen.io/quanzhiyuan-the-scripter/pen/MWJaBaz

niabot commented 3 years ago

This is not possible. The value of the CSS variable --theme-color is only known by the browser at runtime. Less will only see the text input "var(--theme-color, #5582F3)" at compile time and can't apply a color function to it.

iChenLei commented 3 years ago

Duplicate https://github.com/less/less.js/issues/3611