diff options
-rw-r--r-- | content/assets/javascripts/clipboardjs.js | 6 | ||||
-rw-r--r-- | content/assets/stylesheets/stylesheet.scss | 9 |
2 files changed, 8 insertions, 7 deletions
diff --git a/content/assets/javascripts/clipboardjs.js b/content/assets/javascripts/clipboardjs.js index d81298bc..92cd0ae3 100644 --- a/content/assets/javascripts/clipboardjs.js +++ b/content/assets/javascripts/clipboardjs.js @@ -1,9 +1,9 @@ --- -version: 1 +version: 2 --- -// add a copy button to every code // working -$('pre').append($('<button class="clip-btn" title="Click to copy" data-selector="true"><i class="fa fa-clipboard" aria-hidden="true"></i></button>')); +// Add a copy button to every fenced code block +$('pre').append($('<button class="clip-btn" title="Click to copy" data-selector="true"><%= icon("copy-to-clipboard") %></button>')); // Tooltip $('button').tooltip({ diff --git a/content/assets/stylesheets/stylesheet.scss b/content/assets/stylesheets/stylesheet.scss index a5490428..1c0b641a 100644 --- a/content/assets/stylesheets/stylesheet.scss +++ b/content/assets/stylesheets/stylesheet.scss @@ -1,5 +1,5 @@ --- -version: 88 +version: 89 --- @import "variables"; @@ -153,14 +153,15 @@ pre { top: 0; cursor: pointer; position: absolute; - color: $white; + fill: $white; background-color: $pre-code-color; border: 0; outline: 0; - i { + svg { opacity: .5; transition: opacity .3s ease-in; + pointer-events: none; } @media all and (max-width: $sm-width) { @@ -170,7 +171,7 @@ pre { &:hover { .clip-btn { - i { + svg { opacity: 1; } } |