TL;DR CSS now has a proper object-based API for working with values in JavaScript. el.attributeStyleMap.set('padding', CSS.px(42)); const padding = el.attributeStyleMap.get('padding'); console.log(padding.value, padding.unit); // 42, 'px' The days of concatenating strings and subtle bugs are over! Introduction Old CSSOM CSS has had an object model (CSSOM) for many years. In fact, any time you read