Thomas Michael Semmler on Nostr: So, I use getPropertyValue() quite often to read some value from CSS custom ...
So, I use getPropertyValue() quite often to read some value from CSS custom properties. But I fail when it contains one of those awesome #CSS values, like clamp() or max().
Is there a way in #javascript to somehow get the computed, calculated pixel value of something like this?
Background here is that I am working with a javascript library that requires some things to be set in pixel values, but I work with fluid values all throughout the site.
Published at
2025-09-02 20:04:53 UTCEvent JSON
{
"id": "7c7ca0c0e83086375ad4170b12f99b0f079a58cd83f6b473a1181a775067e5a8",
"pubkey": "f86500d735ea38e3a46676bcd70601111127eb346aa80670240772c8b73bebc5",
"created_at": 1756843493,
"kind": 1,
"tags": [
[
"t",
"css"
],
[
"t",
"javascript"
],
[
"proxy",
"https://indieweb.social/@nachtfunke/115136495220868490",
"web"
],
[
"proxy",
"https://indieweb.social/users/nachtfunke/statuses/115136495220868490",
"activitypub"
],
[
"L",
"pink.momostr"
],
[
"l",
"pink.momostr.activitypub:https://indieweb.social/users/nachtfunke/statuses/115136495220868490",
"pink.momostr"
],
[
"-"
]
],
"content": "So, I use getPropertyValue() quite often to read some value from CSS custom properties. But I fail when it contains one of those awesome #CSS values, like clamp() or max().\n\nIs there a way in #javascript to somehow get the computed, calculated pixel value of something like this?\n\nBackground here is that I am working with a javascript library that requires some things to be set in pixel values, but I work with fluid values all throughout the site.",
"sig": "b6e58ed4c3959202224f4ad2580149485ae9c18ebe6271d03a071a3aaf64202edb4b0b6e25b161ece4290d5d433481cf58dece182dd760d1ca14041cc3e322e5"
}