mirror of
https://github.com/lingble/talos.git
synced 2026-01-12 09:25:07 +00:00
Enable code blocks copying Ref: https://aaronluna.dev/blog/add-copy-button-to-code-blocks-hugo-chroma/ Supersedes #5235 Signed-off-by: Noel Georgi <git@frezbo.dev>
68 lines
1.2 KiB
CSS
68 lines
1.2 KiB
CSS
.highlight-wrapper {
|
|
display: block;
|
|
}
|
|
|
|
.highlight {
|
|
position: relative;
|
|
z-index: 0;
|
|
padding: 0;
|
|
margin: 0;
|
|
border-radius: 4px;
|
|
}
|
|
|
|
code[data-lang]:before {
|
|
color: #d0d0d0;
|
|
background-color: #002b36;
|
|
position: absolute;
|
|
z-index: 0;
|
|
top: -22px;
|
|
left: 0px;
|
|
content: attr(data-lang);
|
|
border-top-left-radius: 4px;
|
|
border-top-right-radius: 4px;
|
|
border-bottom-left-radius: 0;
|
|
border-bottom-right-radius: 0;
|
|
padding: 5px 10px 7px;
|
|
}
|
|
|
|
.copy-code-button {
|
|
position: absolute;
|
|
z-index: 2;
|
|
right: 0;
|
|
top: 0;
|
|
font-size: 13px;
|
|
font-weight: 700;
|
|
line-height: 14px;
|
|
letter-spacing: 0.5px;
|
|
width: 65px;
|
|
color: #232326;
|
|
background-color: #7f7f7f;
|
|
border: 1.25px solid #232326;
|
|
border-top-left-radius: 0;
|
|
border-top-right-radius: 4px;
|
|
border-bottom-right-radius: 0;
|
|
border-bottom-left-radius: 4px;
|
|
white-space: nowrap;
|
|
padding: 4px 4px 5px 4px;
|
|
margin: 0 0 0 1px;
|
|
cursor: pointer;
|
|
opacity: 0.6;
|
|
}
|
|
|
|
.copy-code-button:hover,
|
|
.copy-code-button:focus,
|
|
.copy-code-button:active,
|
|
.copy-code-button:active:hover {
|
|
color: #222225;
|
|
background-color: #b3b3b3;
|
|
opacity: 0.8;
|
|
}
|
|
|
|
.copyable-text-area {
|
|
position: absolute;
|
|
height: 0;
|
|
z-index: -1;
|
|
opacity: .01;
|
|
}
|
|
|