mutation-summary
mutation-summary copied to clipboard
Observing changes to styles?
Hi, I've been taking a look at mutation-summary for a project I'm working on. Great library, very impressive, thanks to all for their work on it.
For my use case, it would be helpful to have something specific to detecting and working with style changes. At present, if you change a style of some element (let's say you set background-color to "red" or whatever using the browser's dev tools / inspector panel), the MutationSummary picks that up as an attribute-level change on the "style" attribute. This is of course very helpful already, but it would be even better to be able to set some kind of optional flag that also gave me the CSS styles that had changed/added/removed on each element, etc.
Does anyone know if I'm missing something that's already in place somewhere that I'm just missing? If not, and if I were to write a bit of code that "notices" the additions/removals/changes, which I suspect would be pretty straightforward, would you be interested in a PR contribution etc., or do you feel that this kind of thing should stay out of the library's scope?
That's not a bad idea.
This has been helpful for me, as long as you know what you trying to look for.
var CSSheight = window.getComputedStyle(elem,null).getPropertyValue("height");