Skip to content

Commit dde5fd7

Browse files
committed
replace code- prefix with source- in source block toolbox
1 parent ccedf64 commit dde5fd7

File tree

2 files changed

+12
-12
lines changed

2 files changed

+12
-12
lines changed

src/css/doc.css

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -667,7 +667,7 @@
667667
user-select: none;
668668
}
669669

670-
.doc .code-toolbox {
670+
.doc .source-toolbox {
671671
display: flex;
672672
visibility: hidden;
673673
position: absolute;
@@ -678,19 +678,19 @@
678678
line-height: 1;
679679
}
680680

681-
.doc .listingblock:hover .code-toolbox {
681+
.doc .listingblock:hover .source-toolbox {
682682
visibility: visible;
683683
}
684684

685-
.doc .code-toolbox .code-lang {
685+
.doc .source-toolbox .source-lang {
686686
text-transform: uppercase;
687687
}
688688

689-
.doc .code-toolbox > :not(:last-child)::after {
689+
.doc .source-toolbox > :not(:last-child)::after {
690690
content: " | ";
691691
}
692692

693-
.doc .code-toolbox .copy-button {
693+
.doc .source-toolbox .copy-button {
694694
display: flex;
695695
flex-direction: column;
696696
align-items: center;
@@ -705,17 +705,17 @@
705705
height: 1.05em;
706706
}
707707

708-
.code-toolbox .copy-button * {
708+
.source-toolbox .copy-button * {
709709
flex: none;
710710
}
711711

712-
.code-toolbox .copy-button svg {
712+
.source-toolbox .copy-button svg {
713713
fill: currentColor;
714714
width: inherit;
715715
height: inherit;
716716
}
717717

718-
.code-toolbox .copy-toast {
718+
.source-toolbox .copy-toast {
719719
position: relative;
720720
display: inline-flex;
721721
justify-content: center;
@@ -730,7 +730,7 @@
730730
transition: opacity 0.5s ease 0.75s;
731731
}
732732

733-
.code-toolbox .copy-toast::after {
733+
.source-toolbox .copy-toast::after {
734734
content: "";
735735
position: absolute;
736736
top: 0;
@@ -742,7 +742,7 @@
742742
transform-origin: left;
743743
}
744744

745-
.code-toolbox .copy-button.clicked .copy-toast {
745+
.source-toolbox .copy-button.clicked .copy-toast {
746746
opacity: 1;
747747
transition: none;
748748
}

src/js/06-copy-to-clipboard.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
if (pre.classList.contains('highlight')) {
66
code = pre.querySelector('code')
77
if ((language = code.dataset.lang) && language !== 'console') {
8-
;(lang = document.createElement('span')).className = 'code-lang'
8+
;(lang = document.createElement('span')).className = 'source-lang'
99
lang.appendChild(document.createTextNode(language))
1010
}
1111
} else if (pre.innerText.startsWith('$ ')) {
@@ -21,7 +21,7 @@
2121
} else {
2222
return
2323
}
24-
;(toolbox = document.createElement('div')).className = 'code-toolbox'
24+
;(toolbox = document.createElement('div')).className = 'source-toolbox'
2525
if (lang) toolbox.appendChild(lang)
2626
if (window.navigator.clipboard) {
2727
;(copy = document.createElement('button')).className = 'copy-button'

0 commit comments

Comments
 (0)