Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Observing changes to styles? #26

Open
nateweiss opened this issue Oct 15, 2016 · 1 comment
Open

Observing changes to styles? #26

nateweiss opened this issue Oct 15, 2016 · 1 comment

Comments

@nateweiss
Copy link

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?

@tomgallagher
Copy link

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");

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants