calc

Shouldn't this be working with calc
width: calc(300px - (padding-left + padding-right));
width: calc(300px - (padding-left + padding-right));
5 Replies
NazCodeland
NazCodelandOP3y ago
Nvm, I see what I am doing wrong, calc isn't able to get the value from css property names but if I change those to css variables, it worked.
.is-full{
--padding-left: 50px;
--padding-right: 50px;

padding-left: var(--padding-left);
padding-right: var(--padding-right);


width: calc(300px - (var(--padding-left) + var(--padding-right)));
.is-full{
--padding-left: 50px;
--padding-right: 50px;

padding-left: var(--padding-left);
padding-right: var(--padding-right);


width: calc(300px - (var(--padding-left) + var(--padding-right)));
}
b1mind
b1mind3y ago
Correct
NazCodeland
NazCodelandOP3y ago
Is that the best solution??
b1mind
b1mind3y ago
I don't know looks fine
NazCodeland
NazCodelandOP3y ago
ok, thank you
Want results from more Discord servers?
Add your server