1

I have a var like this:

--size-sm: 15px;

And want to use it for a negative margin.

        a:first-child {
          margin-left: var(--size-sm);
        }

Is there any way how the value could be inverted? I tried few syntax like margin-left: -var(--size-sm); and margin-left: -(--size-sm); without success.

BoltClock
  • 700,868
  • 160
  • 1,392
  • 1,356
Andreas Galster
  • 415
  • 4
  • 17
  • 3
    Does `calc(-1 * var(--size-sm))` work? – Ry- Feb 24 '19 at 04:36
  • Yes it works, how didn't I think of this :). As marked by BoltClock, there's an extensive explanation in the question that's already been answered. Sorry for the duplicate. – Andreas Galster Feb 26 '19 at 02:36

0 Answers0