lucide icon indicating copy to clipboard operation
lucide copied to clipboard

[Feature] Allow copying SVG icon as one line.

Open Teraskull opened this issue 3 years ago • 2 comments

If you click Copy SVG, it copies like this:

<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
  <path d="M20 16.2A4.5 4.5 0 0017.5 8h-1.8A7 7 0 104 14.9"></path>
  <path d="M12 12v9"></path>
  <path d="M8 17l4 4 4-4"></path>
</svg>

But often inline SVG is used, and it does not allow line breaks:

.example-icon:after {
    content: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M20 16.2A4.5 4.5 0 0017.5 8h-1.8A7 7 0 104 14.9"></path><path d="M12 12v9"></path><path d="M8 17l4 4 4-4"></path></svg>');
}

Would be nice to have another copy button for this.

Teraskull avatar Dec 17 '21 18:12 Teraskull

Good idea, we can add it as a feature on the website!

ericfennis avatar Dec 19 '21 12:12 ericfennis

Meanwhile try this tool

https://jakearchibald.github.io/svgomg/

nixoncode avatar Jan 09 '22 02:01 nixoncode

Fixed this one in #796. It now copies svgs in on line as default

ericfennis avatar Nov 15 '22 10:11 ericfennis