Calc()

To use CSS's calc(), use any of Calculation's value constructors.

cadd(px(10), per(100)) -> 'calc(10px + 100%)'
csub(vw(100), px(10)) -> 'calc(100vw - 10px)'
cmult(per(50), 3)) -> 'calc(50% * 3)'
cdiv(per(100), 2) -> 'calc(100% / 2)'

Nested calc() expressions#

cadd(px(300), cadd(px(200), per(100))) -> 'calc(300px + calc(200px + 100%))'