Email or username:

Password:

Forgot your password?
Bramus

Introducing @​bramus/style-observer, a MutationObserver for CSS.

It allows you to attach JavaScript callbacks to changes in computed values of CSS properties.

🔗 bram.us/2024/08/31/introducing

Logo for @bramus/style-observer
1 comment
Bramus

Version 1.2.0 of @bramus/style-observer got published just now.

Since v1.0.0, two options were added:

- notificationMode: pass all properties or only the changed ones into the callback

- returnFormat: pass only the values or a full object with detailed info into the callback

Here’s an example of the extended return format:

```json
{
"--my-variable":{
"value": "1.0",
"previousValue": "0.0",
"changed": true
}
}
```

github.com/bramus/style-observ

Version 1.2.0 of @bramus/style-observer got published just now.

Since v1.0.0, two options were added:

- notificationMode: pass all properties or only the changed ones into the callback

- returnFormat: pass only the values or a full object with detailed info into the callback

Here’s an example of the extended return format:

Go Up