CSS custom properties with negative values

23
November, 2022

--padding: 10px;

.class {
     	margin:
  		var(--padding)
  		calc(var(--padding) * -1)
  		var(--padding)
  		calc(var(--padding) * -1);
}

 

SCSS equivalent:

$padding: 10px;

.class {
	margin:
		$padding
		(-$padding)
		$padding
		(-$padding);
}