Style Observer
CSS 속성이 변경될 때 추척할 수 있는 라이브러리 입니다.
사용 방법
const observer = new StyleObserver(records => console.log(records));
observer.observe(document.querySelector("#my-element"), "--my-custom-property");
여러 속성을 동시에 관찰할 수도 있습니다.
const observer = new StyleObserver(records => console.log(records));
const properties = ["color", "--my-custom-property"];
const targets = document.querySelectorAll(".my-element");
observer.observe(targets, properties);