material-design-icons icon indicating copy to clipboard operation
material-design-icons copied to clipboard

Copy SVG icon content to clipboard

Open quyleanh opened this issue 4 years ago • 10 comments

How can I do quick copy SVG icon content to clipboard?

For example when I do copy instead of download, the clipboard content will be something like this

<svg fill="none" viewBox="0 0 24 24" height="24" width="24" xmlns="http://www.w3.org/2000/svg">
<path xmlns="http://www.w3.org/2000/svg" fill-rule="evenodd" clip-rule="evenodd" d="M12 4C12.5523 4 13 4.44772 13 5V16.5858L17.2929 12.2929C17.6834 11.9024 18.3166 11.9024 18.7071 12.2929C19.0976 12.6834 19.0976 13.3166 18.7071 13.7071L12.7071 19.7071C12.3166 20.0976 11.6834 20.0976 11.2929 19.7071L5.29289 13.7071C4.90237 13.3166 4.90237 12.6834 5.29289 12.2929C5.68342 11.9024 6.31658 11.9024 6.70711 12.2929L11 16.5858V5C11 4.44772 11.4477 4 12 4Z" fill="#282828"></path>
</svg>

quyleanh avatar Oct 15 '20 17:10 quyleanh

Yup, would be extra cool

nt4f04uNd avatar Oct 17 '20 00:10 nt4f04uNd

I had nothing to do so I created a script for tampermonkey till this won't be added https://github.com/nt4f04uNd/tampermonkey-scripts/

nt4f04uNd avatar Oct 17 '20 01:10 nt4f04uNd

@nt4f04uNd so cool. Thank you for your kind help. Hope this will be added soon on the main website.

quyleanh avatar Oct 17 '20 07:10 quyleanh

@quyleanh fixed it a bit, so if you been using it, you can update

nt4f04uNd avatar Oct 17 '20 08:10 nt4f04uNd

@nt4f04uNd could you please update for https://fonts.google.com/icons site? Thank you.

quyleanh avatar Mar 03 '21 11:03 quyleanh

@quyleanh i opened dedicated issue in google fonts repository and updated the script in the meantime https://github.com/nt4f04uNd/tampermonkey-scripts/

nt4f04uNd avatar Mar 03 '21 16:03 nt4f04uNd

@nt4f04uNd thank you for your kind support.

quyleanh avatar Mar 03 '21 17:03 quyleanh

Yes this is a very useful enhancement.


Steps for putting SVG code directly in the components

  • Downloading an SVG
  • Open file
  • View source
  • Select all
  • Copy

Would be nice to have a SVG copy to clipboard option

  • Copy SVG

Example out in the wild: https://heroicons.com/

--

Pros: Reduce HTTP requests for downloads

dillingham avatar Mar 08 '21 18:03 dillingham

Seems like a feature to add to https://fonts.google.com/icons

tphinney avatar May 04 '22 21:05 tphinney

Any news on this?

inwardmovement avatar Feb 28 '24 13:02 inwardmovement