DEV Community

Discussion on: Simple way to negate a number in CSS

Collapse
 
alohci profile image
Nicholas Stimpson

You could subtract from 0px too, like this:

margin: calc(0px - var(--base-padding));
Collapse
 
dzhavat profile image
Dzhavat Ushev

That's great! Thanks for sharing it. We can even save 2 characters by removing the px. It's not really needed :)