Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"prettier.requireConfig": true
}
12 changes: 12 additions & 0 deletions clip.min.js
Original file line number Diff line number Diff line change
Expand Up @@ -1853,3 +1853,15 @@ function codePen() {

$form.submit();
}


async function copyToClipboard() {
const code = $unprefixed.text();

try {
await navigator.clipboard.writeText(code);
alert('Code copied!');
} catch (err) {
alert('Failed to copy: ');
}
}
2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ <h2>Round edges</h2>
-->
<code class="unprefixed block show">clip-path: <span class="functions"></span>;</code>
</div>
<!-- <button class="edit-in-codepen code"></button> -->
<button class="code btn-copy" onclick="copyToClipboard();">Copy</button>
</section>
</div>
<div class="side">
Expand Down
4 changes: 4 additions & 0 deletions style.min.css
Original file line number Diff line number Diff line change
Expand Up @@ -866,6 +866,10 @@ figure figcaption {
flex: 1;
}

.btn-copy {
cursor: pointer;
}

@media (min-width: 800px) {
.css-code {
margin-right: 0.5vw;
Expand Down