Re: [csswg-drafts] [cssom] `ComputedStyleObserver` to observe changes in elements' computed styles (#8982)

Building upon Jake’s suggestion to use `allow-discrete` and the `ccs-variable-observer` library linked before, I built a thing:  https://github.com/bramus/style-observer

It’s a `MutationObserver` for CSS, powered by CSS Transitions and `transition-behavior: allow-discrete`. You can use this to track changes in any CSS Property, including Custom Properties _(except in Chrome because [it has an `allow-discrete` bug](https://issues.chromium.org/issues/360159391) 😭)_

Would still love to see something built into the CSS though, as this library zaps any of the existing transitions applied onto the element.



-- 
GitHub Notification of comment by bramus
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/8982#issuecomment-2318817849 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Thursday, 29 August 2024 19:52:44 UTC