1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49
|
pre {
position: relative;
}
pre:hover .copy-button,
pre .copy-button:focus {
opacity: 1;
}
.copy-button {
display: flex;
opacity: 0;
position: absolute;
top: 5px;
right: 5px;
padding: 4px;
background-color: var(--codeBackground);
border: none;
cursor: pointer;
transition: all 150ms;
font-family: var(--defaultFontFamily);
font-size: 14px;
line-height: 24px;
color: currentColor;
}
.copy-button svg {
opacity: 0.5;
transition: all 150ms;
}
pre .copy-button:hover svg,
pre .copy-button:focus-visible svg {
opacity: 1;
}
.copy-button svg {
width: 20px;
}
.copy-button.clicked {
opacity: 1;
color: var(--success);
}
.copy-button.clicked svg {
display: none;
color: currentColor;
}
|