Open evanliomain opened 17 hours ago
Not a direct implementation advice, just posting this for inspiration.
I made an Element tracker, which attaches a Mutation Observer to the preview iframe and passes back the computed style for the properties you specify, i chose to always display width, height and background-color (not background).
The CSS property list is populated by getting the Object keys of a random DOM element. The image provides more info, some small additional features are the element position, link to the MDN documentation, color previews.
Note: In case of transform: ... , it even calculates the matrix for you by default.
Afaik you wanted to include the nesting info, so your implementation is probably different.
I was thinking of a lighter version. Here an ongoing version, but still in progress.
Add a dom inspector tools, so I no longer need to use devtools inspector to see what happen in the output iframe.