blog

Append unit to a unitless CSS custom property

https://www.kevinpowell.co/article/how-to-append-a-unit-to-a-custom-property-with-calc/

TL;DR: use calc like so calc(var(--unitless) * 1px).