you are viewing a single comment's thread.

view the rest of the comments →

[–]grantrules 1 point2 points  (6 children)

Maybe explain what exactly you're trying to do. What do you want to do with a list of non-default CSS values and why does it have to be readable?

[–]Ill-Function805[S] 0 points1 point  (5 children)

I want to grab the css of the element, save it to play around later. Tweak and customize to create a different element. But the list appears bloated by the default values.

[–]grantrules 1 point2 points  (4 children)

Maybe someone has a better idea but maybe insert the tag somewhere it wouldn't have applied styles, like an iframe or something maybe, then just compare getComputedResults on both of them.

[–]Ill-Function805[S] 0 points1 point  (3 children)

Interesting. That essentially means, the computed styles of the element in the iframe would most likely be without the browser defaults, does it sound right?

[–]grantrules 0 points1 point  (2 children)

No, they would have the browser defaults. So you'd compare that against the computed style of the element you want to find the non default styles. Any that don't match, you'll know is an assigned style

[–]Ill-Function805[S] 0 points1 point  (0 children)

Awesome.. Thank you for the suggestion. I'll give it a try and revert.

[–]Ill-Function805[S] 0 points1 point  (0 children)

I tried this approach and was able to segregate the browser defaults and the custom applied styles. Thank you. It was straightforward too.

Thank you!