ifconfig.io icon indicating copy to clipboard operation
ifconfig.io copied to clipboard

Easier cURL command copy/paste

Open JeffAlyanak opened this issue 2 years ago • 1 comments

To make copying of the cURL commands a bit easier, would it make sense to update the template slightly to make the $ unselectable?

This would only require a couple of small changes (and I'd be happy to put together the pull request if you think the change makes sense):

First, the addition of a bit of CSS. A minified version of:

.unselectable {
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -khtml-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

Second, the wrapping of each $ with a span of said class:

<span class="unselectable">$ </span>

With those changes the user could triple-click or drag select the command without risk of picking up the $ .

JeffAlyanak avatar Sep 23 '22 16:09 JeffAlyanak

Sounds good to me!

We also could remove the $ entirely

georgyo avatar Sep 24 '22 13:09 georgyo