This note has an interactive demo. Try it in the original
Since Firefox 161 shipped on November 24, 2026, JavaScript in every major engine can read and write CSS as typed objects ( { value: 3, unit: "cm" } ) instead of strings like "3cm" . The CSS Typed Object Model has been in Chrome since version 66 and in Safari since 16.4. Firefox was the last one missing, so it's now Baseline.
It sounds like a small detail, and it mostly is. But anyone who has written el.style.width = size + 'px' and then parseFloat(getComputedStyle(el).width) to read it back knows how much glue code it replaces.
What it is and why it matters
The classic CSSOM speaks in strings. You build them by concatenating values and units, and you parse them back with parseFloat and a little hope. The Typed OM hands you objects instead. A length is a CSSUnitValue with a value and a unit . A calc() comes back as a CSSMathSum whose parts you can inspect. A keyword like auto is a CSSKeywordValue .…