Skip to content

Commit 3029695

Browse files
Use the correct icon in the mdbook guide for the copy-paste icon
1 parent 8befcc7 commit 3029695

File tree

2 files changed

+17
-2
lines changed

2 files changed

+17
-2
lines changed

crates/mdbook-html/front-end/css/chrome.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,7 @@ pre > .buttons button {
266266
pre > .buttons button.clip-button {
267267
padding: 2px 4px 0px 6px;
268268
}
269-
pre > .buttons button.clip-button::before {
269+
.clip-button::before {
270270
/* clipboard image from octicons (https://github.com/primer/octicons/tree/v2.0.0) MIT license
271271
*/
272272
content: url('data:image/svg+xml,<svg width="21" height="20" viewBox="0 0 24 25" \

guide/src/guide/reading.md

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,24 @@ Clicking a highlighted word or pressing the <kbd>Escape</kbd> key will remove th
5656
mdBook books are often used for programming projects, and thus support highlighting code blocks and samples.
5757
Code blocks may contain several different icons for interacting with them:
5858

59+
<style>
60+
.light .table-wrapper .clip-button, .rust .table-wrapper .clip-button {
61+
--copy-button-filter: initial;
62+
}
63+
.coal .table-wrapper .clip-button {
64+
--copy-button-filter: brightness(0) saturate(100%) invert(72%) sepia(9%) saturate(401%) hue-rotate(167deg) brightness(90%) contrast(84%);
65+
}
66+
.navy .table-wrapper .clip-button {
67+
--copy-button-filter: brightness(0) saturate(100%) invert(88%) sepia(6%) saturate(563%) hue-rotate(200deg) brightness(89%) contrast(84%);
68+
}
69+
.ayu .table-wrapper .clip-button {
70+
--copy-button-filter: brightness(0) saturate(100%) invert(88%) sepia(2%) saturate(2%) hue-rotate(16deg) brightness(89%) contrast(94%);
71+
}
72+
</style>
73+
5974
| Icon | Description |
6075
|------|-------------|
61-
| <i class="fa fa-copy"></i> | Copies the code block into your local clipboard, to allow pasting into another application. |
76+
| <i class="clip-button"></i> | Copies the code block into your local clipboard, to allow pasting into another application. |
6277
| <i class="fa fa-play"></i> | For Rust code examples, this will execute the sample code and display the compiler output just below the example (see [playground]). |
6378
| <i class="fa fa-eye"></i> | For Rust code examples, this will toggle visibility of "hidden" lines. Sometimes, larger examples will hide lines which are not particularly relevant to what is being illustrated (see [hiding code lines]). |
6479
| <i class="fa fa-history"></i> | For [editable code examples][editor], this will undo any changes you have made. |

0 commit comments

Comments
 (0)