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

Attach styles to nodes in HTML import #506

Open
johno opened this issue Jul 19, 2022 · 0 comments
Open

Attach styles to nodes in HTML import #506

johno opened this issue Jul 19, 2022 · 0 comments
Labels
Compilation Parsing and serialization Feature New feature or request HTML GUI

Comments

@johno
Copy link
Contributor

johno commented Jul 19, 2022

HTML elements can have attached style strings that should be converted to the internal style object. This should be relatively straightforward, though we need to write a CSS => schema converter which also handles parsing/tokenizing the values in the style/CSS declarations.

There can also be style tags which have CSS. We'll need to attach those to the relevant nodes. This is quite a bit trickier since we'll need to effectively handle selectors and style resolution. One idea I have regarding this is to render the HTML somewhere in the background (after sanitizing) and then using getComputedStyle to attach the relevant styles.

@johno johno added Feature New feature or request Compilation Parsing and serialization HTML GUI labels Jul 19, 2022
johno added a commit that referenced this issue Jul 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Compilation Parsing and serialization Feature New feature or request HTML GUI
Projects
None yet
Development

No branches or pull requests

1 participant