Skip to content

Commit d15b1c0

Browse files
committed
Use smaller icons for the "Copy" button in code snippets.
1 parent 4d5f640 commit d15b1c0

File tree

3 files changed

+15
-5
lines changed

3 files changed

+15
-5
lines changed

lib/ffdocs/view/javascript/clipboard.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,12 @@ document.addEventListener("DOMContentLoaded", () => {
1818
let button = document.createElement("BUTTON");
1919

2020
button.classList.add("copy");
21-
button.append(document.createTextNode("Copy"));
21+
button.append(document.createTextNode("📋"));
2222

2323
button.addEventListener("click", () => {
2424
navigator.clipboard.writeText(elem.dataset.source).then(
25-
() => { notifyClipboardResult(button, "Copied!"); },
26-
() => { notifyClipboardResult(button, "Failed"); }
25+
() => { notifyClipboardResult(button, ""); },
26+
() => { notifyClipboardResult(button, ""); }
2727
);
2828
});
2929

lib/ffdocs/view/styles/_items.scss

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,8 @@ main.item section {
4949
padding: 1ch;
5050

5151
button.copy {
52+
cursor: pointer;
53+
5254
border: 1px solid var(--item-btncopy-fg);
5355
color: var(--item-btncopy-fg);
5456
background: var(--item-btncopy-bg);
@@ -57,11 +59,17 @@ main.item section {
5759
position: static;
5860
font-size: smaller;
5961

62+
width: 3ch;
63+
height: 3ch;
64+
border-radius: 50%;
65+
66+
justify-content: center;
67+
align-items: center;
68+
6069
&.result {
6170
border-color: var(--item-btncopy-bg);
6271
color: var(--item-btncopy-bg);
6372
background: var(--item-btncopy-fg);
64-
font-size: unset;
6573
pointer-events: none;
6674
}
6775

@@ -72,7 +80,7 @@ main.item section {
7280

7381
&:hover {
7482
button.copy {
75-
display: unset;
83+
display: inline-flex;
7684
}
7785
}
7886
}

lib/ffdocs/view/website.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,8 @@ def render(executor)
135135
@releases.freeze
136136
jobs = []
137137

138+
::FFDocs.log.info "Rendering to #@output"
139+
138140
jobs << Concurrent::Promise.execute(executor: executor) do
139141
::FFDocs::View::VersionMatrixRenderer.new(self).render
140142
true

0 commit comments

Comments
 (0)