Using CSS Variables with Margin & Padding

Sterling Cobb
2 min readSep 12, 2019

You most likely already know about CSS variables. If not, go ahead and DuckDuckGo it (seriously trying to make that a thing) and then come back.

Great.

So you know about this

:root {
--my-var: 42
}
.nice {
var(--my-var)
}

--

--