-
-
Notifications
You must be signed in to change notification settings - Fork 24
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
Feature Request: Support CSS variables for theming #236
Comments
The core of the implementation does not rely on CSS because it might be rendered inside any container so the diagrams would have to evaluate CSS vars during run-time or detect that it is a CSS var and do nothing, this is too complicated. Plus it also have one canvas renderer. |
I'm guessing you want to pre-render SVG from server , and adjust the colors in the browser later ? |
Yes. This is the main benefit of Pintora compared to Mermaid - I don't need runtime on the client. I could as well render two images (light and dark) and use different version depending on the theme, but CSS variables solution seems to be more clear and straightforward (from consumer point of view). Another pros of using inline SVG:
|
Yes SVG indeed gives you all the possibilities to manipulation and enhancement. By now I need to focus on the core functionalities and add more tests for classDiagram for 0.7.0 release. Let's keep this in mind for now. |
I want to pre-render diagram as SVG and embed it in HTML. And I want to style SVG with the help of CSS variables, so that I can add support for dark theme using CSS.
I tried something like this:
But it won't work because some diagrams use
tinycolor
pintora/packages/pintora-diagrams/src/class/config.ts
Lines 66 to 83 in 8ec6708
The text was updated successfully, but these errors were encountered: