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

Missing computedStyle in toDOM #19

Closed
Hypercubed opened this issue Oct 15, 2015 · 2 comments
Closed

Missing computedStyle in toDOM #19

Hypercubed opened this issue Oct 15, 2015 · 2 comments
Labels

Comments

@Hypercubed
Copy link

When using .toJSON with computedStyle: true computed styles are copied to the [node].style object. However, when using .toDOM only the [node].attributes.styles text is added to the element.

@azaslavsky
Copy link
Owner

Hmm, nice catch. I'll take a quick look this week and try to fix it.

@azaslavsky
Copy link
Owner

So I took a (very belated...) look, and this totally makes sense. The computed styles are pulled from two sources: the inline style, and the resolved CSS styles. The resolved styles aren't part of the DOM, so they are not reflected in the output. One solution to this could be to add a applyComputedStyles option to the .toDOM method.

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

No branches or pull requests

2 participants