Here's a simple attempt, where the blue border should be 7px instead of 3px. Why doesn't it work?
:root {
--sum-a: 1px;
--sum-b: 2px;
--sum: (var(--sum-a) + var(--sum-b))
}
div {
width: 100px;
height: 100px;
}
.one {
border: calc(var(--sum)) solid pink;
}
.two {
--sum-a: 4px;
--sum-b: 3px;
border: calc(var(--sum)) solid cornflowerblue;
}
<div class="one"></div>
<div class="two"></div>
I was hoping the --sum-a and --sum-b "args" could be passed into the --sum "function".