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

Another approach is https://github.com/fluorumlabs/css-variable-observer which I found a while ago.

It abuses the `font-variation-settings` property because that one can essentially hold `<string>` values (because `<opentype-tag>` = `<string>`). The property is set to transition really fast and by hooking up a `transitionstart` listener, the change is detected.

Demo using it: https://codepen.io/bramus/details/gOEoKrL _(click the page to change the values of the custom props; the `@property` registration is not mandatory for the code to work)_

-- 
GitHub Notification of comment by bramus
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/8982#issuecomment-2317164825 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 09:37:05 UTC