diff options
author | Evan Read <eread@gitlab.com> | 2020-12-17 18:55:32 +0300 |
---|---|---|
committer | Craig Norris <cnorris@gitlab.com> | 2020-12-17 18:55:32 +0300 |
commit | 07c6d4e7dd45ab83b1accc3d1aedf839c07abf7b (patch) | |
tree | f629dc3927c541308eadcf8b9b748f6b791a2641 | |
parent | cb4db94a62e51acbff660f465ebad560631afe61 (diff) |
Migrate clipboard icon to GitLab SVG
-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; } } |