0

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?

Zoe
  • 27,060
  • 21
  • 118
  • 148
  • 1
    In a way, this is like the common confusion over [trying to trigger server-side code from a client-side event](https://stackoverflow.com/q/13840429/157957): LESS needs to have done all its calculations *before* the CSS is sent to the client, so it can't react to changes in the *client-side* CSS variable. – IMSoP Apr 28 '22 at 10:36
  • there is a way to tell to LESS set the CSS CALC function instead triying to execute the operations? Without afecting the others default operations – blah-iseeyou Apr 28 '22 at 15:50

0 Answers0