'How can we do operations with :root variables (css vars) in LESS?

I´m trying to make operations with the root variables using less.

For example

:root{
  --padding-md: 5px;
}

@padding-md: ~'var(--padding-md)'; // we get the CSS var
@padding-double: @padding-md + 5px; //we try to add 5px

Or this

@padding-md: calc(5px + 3px) + 5px; // we get the CSS var

But LESS just throw the op Is this possible? How to do that?

there is a way to tell to LESS set the CSS CALC function instead make the operations without affect the default less operations?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source