The Wayback Machine - https://web.archive.org/web/20201127050000/https://github.com/litehtml/litehtml/issues/139
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

Sharing CSS? #139

Open
crazydef opened this issue Sep 21, 2020 · 1 comment
Open

Sharing CSS? #139

crazydef opened this issue Sep 21, 2020 · 1 comment

Comments

@crazydef
Copy link

@crazydef crazydef commented Sep 21, 2020

Hi,

Is it possible to pre-load styles from a CSS file and share those styles between multiple documents.

And following on from that, how can I apply a different set of styles to a document at runtime? (I.e., if I wanted to switch between light and dark themes, for example?)

@tordex
Copy link
Member

@tordex tordex commented Oct 12, 2020

Yes, it is possible. Look at createFromString function:

static litehtml::document::ptr createFromString(const tchar_t* str, litehtml::document_container* objPainter, litehtml::context* ctx, litehtml::css* user_styles = 0);

You can use both user_styles and ctx parameters. Both are preloaded css.

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

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.