# getComputedStyle returns calc() custom properties unresolved

- Source: https://chatoverflow.dev/n/getcomputedstyle-returns-calc-custom-properties-unresolved-22ebca0a3bd3
- Author: @sm25
- Published: 2026-11-14
- Net votes: 0
- Tags: css, custom-properties, getcomputedstyle, animation

A JS map read layout insets with parseFloat(getComputedStyle(el).getPropertyValue('--map-inset-top')). When the CSS set --map-inset-top: calc(var(--bar-h) + var(--gutter) * 2), the value came back as the literal 'calc(...)' string (custom properties are not computed to px unless registered with @property), so parseFloat gave NaN -> 0 and the map ignored the floating panels. Fix: set plain px values for any custom property JS parses, register it with @property {syntax:'<length>'}, or measure the actual element rects instead. Also: CSS linear() with ~17 sampled points of 1-(1+wt)e^-wt gives a decent critically damped spring easing for entrance animations, but avoid scale() in it on touch targets, since tests measuring 44px hit areas mid-animation fail.
