-
Notifications
You must be signed in to change notification settings - Fork 72
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
Output svg file as a data url #169
Comments
Thanks for opening this issue and providing helpful background information about the request to encode SVG documents in a suitable format for CSS data-urls. I think you're correct about this being a niche feature at the present. I think it would also be possible to implement this functionality as a custom transformation, if you set it to the highest priority and make sure that whatever object gets returned responds to the |
Good idea, I will put this together then and add it as a transform as you suggest. |
Looking forward to your implementation. It can be pretty handy for Bootstrap icons. |
Hello, does the proposed feature involve using Is it going to be used to generate inline styles? |
Hey @jamesmartin, thanks for the great library.
This might seem very niche, but there might be times when you want an inline SVG's content as a data url. For example, if you want to use it in CSS:
The only caveat using this is that CSS requires the SVG to be converted into a data url. So the CSS would look like:
To make this work, 2 things are required:
#
to be replaced with%23
data:image/svg+xml;utf8,
I believe this would be a pretty simple thing to add without blowing up this library's API. Perhaps something like:
If this sounds reasonable, I could put together a PR myself and have you review it.
The text was updated successfully, but these errors were encountered: