obsidian-code-block-copy icon indicating copy to clipboard operation
obsidian-code-block-copy copied to clipboard

Have icon instead of "copy" text

Open NomarCub opened this issue 5 years ago • 6 comments

Replace (possibly optionally) the "copy" and "copied!" text with a transparent SVG icon. This also makes the plugin language independent.

NomarCub avatar Nov 16 '20 14:11 NomarCub

Yes good idea, I will try to update the plugin with this suggestion soon.

Do you have a suggestion for an SVG icon? I also need to figure out how to make the icon respect the light/dark theme

jdbrice avatar Nov 17 '20 15:11 jdbrice

I looked around. Don't know about the legality or the style coherence though. Take a pick if you want.

Remix Icon

Someone mentioned remix icons unrelated to this on the forums, which are free. Searching for 'copy' there yielded me 6 nice icons.

"Built in"

You could pick one from the ones already used by the app. There's a list of them pinned in the plugin channel of the official Discord. The 'Insert template' icon looks like a copy icon, but that might be confusing. Here's that icon.

<svg viewBox="0 0 100 100" width="18" height="18" class="documents">
    <path fill="currentColor" stroke="currentColor"
        d="M74,4c-0.1,0-0.2,0-0.3,0H40v11.5l4,4V8h28v20h20v48H64v4h32V26.3c0-0.2,0-0.4,0-0.6v-0.5l-0.4-0.4 c-0.1-0.1-0.2-0.3-0.4-0.4c0,0,0,0,0,0L75.6,4.8c-0.1-0.1-0.2-0.3-0.4-0.4L74.8,4h-0.5C74.2,4,74.1,4,74,4L74,4z M76,10.8L89.2,24 H76V10.8z M38,20c-0.1,0-0.2,0-0.3,0H4v76h56V42.3c0-0.2,0-0.4,0-0.6v-0.5l-0.4-0.4c-0.1-0.1-0.2-0.3-0.4-0.4L39.6,20.7 c-0.1-0.1-0.2-0.3-0.4-0.4L38.8,20h-0.5C38.2,20,38.1,20,38,20z M8,24h28v20h20v48H8L8,24z M40,26.8L53.2,40H40V26.8z M60.5,36 l4,4H84v-4L60.5,36z M64,48v4h12v-4H64z M16,52v4h32v-4H16z M64,60v4h20v-4H64z M16,64v4h24v-4H16z M16,76v4h32v-4H16z">
    </path>
</svg>

Boostnote

<svg width="13" height="13" viewBox="0 0 1792 1792">
    <path d="M768 1664h896v-640h-416q-40 0-68-28t-28-68v-416h-384v1152zm256-1440v-64q0-13-9.5-22.5t-22.5-9.5h-704q-13
        0-22.5 9.5t-9.5 22.5v64q0 13 9.5 22.5t22.5 9.5h704q13 0 22.5-9.5t9.5-22.5zm256 672h299l-299-299v299zm512
        128v672q0 40-28 68t-68 28h-960q-40 0-68-28t-28-68v-160h-544q-40 0-68-28t-28-68v-1344q0-40 28-68t68-28h1088q40 0
        68 28t28 68v328q21 13 36 28l408 408q28 28 48 76t20 88z">
    </path>
</svg>

NomarCub avatar Nov 17 '20 16:11 NomarCub

Good idea! Better only show the icon when hovering on the block.

liukun avatar Nov 27 '20 05:11 liukun

The PRs #6 and #13 already adress this, unfortunately they are not merged yet.

Cito avatar Sep 01 '21 08:09 Cito

There is a fork that seems active, you might want to try with opening issues (and pull requests #6 and #13) there.

NomarCub avatar Sep 01 '21 08:09 NomarCub

Thanks @NomarCub - I just noticed this as well and created superDuperCyberTechno/obsidian-code-copy#4 over there.

Cito avatar Sep 01 '21 12:09 Cito