>>> getComputedStyle(document.body).getPropertyValue("--toolbar-height");
"60px"

Reference: https://developer.mozilla.org/ja/docs/Web/CSS/Using_CSS_custom_properties#Values_in_JavaScript


This page is auto-translated from /nishio/カスタムプロパティをJSで読む using DeepL. If you looks something interesting but the auto-translated English is not good enough to understand it, feel free to let me know at @nishio_en. I’m very happy to spread my thought to non-Japanese readers.