How to do addition or subtraction on CSS Variables?
:root {
--margin: 50px;
--margin--: calc(var(--margin) * -1));
/*
while you may simply write like below
but I love to use as above
coz, we'll only need to change value
in one place if needed
*/
/* --margin--: -50px; */
}
.positive-margin {
margin: var(--margin);
}
.negative-margin {
margin-left: var(--margin--);
}