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

Add the possibility to deliver raw svg #152

Open
blaadje opened this issue Sep 15, 2021 · 3 comments
Open

Add the possibility to deliver raw svg #152

blaadje opened this issue Sep 15, 2021 · 3 comments

Comments

@blaadje
Copy link

blaadje commented Sep 15, 2021

Explain your use case

I'd like to use <CldImage /> component with svg and not retrieving rendered <img /> tag but <svg />

Describe the problem you’re trying to solve

So we can control styling in css such as stroke fill etc. & use cloudinary with svg as hosting only. (no transforms)

Do you have a proposed solution?

Modify Image component api

@patrick-tolosa
Copy link
Contributor

Hey @blaadje

You can use the https://github.com/cloudinary/cloudinary_js package to use plain javascript (Without vue), and use the results wherever you want.

The next generation of the javascript SDK will be released shortly, and can be used as well:
https://github.com/cloudinary/js-url-gen

This feature is currently out of scope for the Vue SDK itself.

@blaadje
Copy link
Author

blaadje commented Sep 15, 2021

Hello @patrick-tolosa , thanks for your answer !
Could you give me an example to do this ? I cannot find anything in the doc close to that :(

@patrick-tolosa
Copy link
Contributor

The key thing to consider is the separation of concerns, the first task is to create a URL with your desired transformation

Once you created your URL, you can use it in whatever element you want.
your custom image element, an SVG, a CSS background (using javascript to inject the CSS), or anything else.

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

No branches or pull requests

2 participants