mrcrowl / vscode-easy-less

Easy LESS extension for Visual Studio Code
MIT License
67 stars 23 forks source link

Variable multiple does not work #62

Closed airsence closed 4 years ago

airsence commented 4 years ago

Version 1.6.3

When I use auto compile from Less to CSS, I found that the multiple calculation is not working.

In Less:

@col = 8.33%;
:root{
--header-logo-height: 10 * @col;
}

In CSS:

:root{
--header-logo-height: 10 * 8.33%;
}
mrcrowl commented 4 years ago

This is the same behaviour that you get from less itself, when you prefix a style with double dash: --

You can verify this by pasting your code into the Less Playground.

The code I used (edited slightly from your question was):

@col: 8.33%;

:root {
    --header-logo-height: (10 * @col);
}

You'll notice that if you remove one of the dashes from in front of the header-logo-height, the calculation works as expected. You might need to open an issue with less itself.