Skip to content

Commit

Permalink
Merge pull request #35 from qoherent/fix-copy-button
Browse files Browse the repository at this point in the history
fix copy button not showing in prod
  • Loading branch information
UmairK5669 authored Sep 10, 2024
2 parents 7bda3ab + 2b29556 commit 404d0c6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
4 changes: 2 additions & 2 deletions themes/hugoplate/assets/js/copybutton.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ function addCopyButtonToCodeBlocks() {
const codeBlocks = document.querySelectorAll(
'pre > code[class^="language-"]'
);
const copyIcon = '<i class="fas fa-copy"></i>';
const copiedIcon = '<i class="fas fa-check"></i>';
const copyIcon = '<i class="fa-solid fa-copy"></i>';
const copiedIcon = '<i class="fa-solid fa-check"></i>';

codeBlocks.forEach((codeBlock) => {
codeBlock.style.backgroundColor = "#272822";
Expand Down
6 changes: 4 additions & 2 deletions themes/hugoplate/assets/scss/base.scss
Original file line number Diff line number Diff line change
Expand Up @@ -71,12 +71,14 @@ strong {
font-size: 80%;
}

.btn.copy-code-button:hover i.fas.fa-copy::before{
.btn.copy-code-button:hover i.fa-solid.fa-copy::before {
color: #884da0 !important;
font-family: 'Font Awesome 6 Free';
}

.btn.copy-code-button:hover i.fas.fa-check::before{
.btn.copy-code-button:hover i.fa-solid.fa-check::before {
color: #884da0 !important;
font-family: 'Font Awesome 6 Free';
}

.notice {
Expand Down

0 comments on commit 404d0c6

Please sign in to comment.