-
Notifications
You must be signed in to change notification settings - Fork 228
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
Support var when resolving colors #821
Comments
Thinking about it a bit more though, implementing this properly would probably require full-blown support for resolving variables in resvg (including its dependencies), so I guess this won't happen for a while... |
This should be implemented in |
Tbh, just having a way to define color variables (even without fallback) would be nice. It would greatly simplify cases like svg icon rasterization in programs where the colors might have to change. e.g. if you want to animate icon button color on hover, currently you have to:
|
I'm waiting for feedback, but yeah, after delving into this a bit, it seems like it requires a lot of breaking changes to most CSS related dependencies. It also complicates code a lot because none of these crates expect values to change after initial parsing. EDIT: However, this feature would be very useful when integrating resvg into other programs so it might be worth implementing. |
See here: https://developer.mozilla.org/en-US/docs/Web/CSS/var
Reason I want this is that the SVG OpenType spec allows reference CPAL palettes via vars. They way this should probably work is that the user can optionally provide a callback function that receives a string and then optionally returns a color.
The text was updated successfully, but these errors were encountered: