feat: #9 add copy code button

This commit is contained in:
Yifei Zhang
2023-03-26 12:29:02 +00:00
parent df66eef919
commit e57bd51809
3 changed files with 59 additions and 5 deletions

View File

@@ -206,3 +206,36 @@ div.math {
text-decoration: underline;
}
}
pre {
position: relative;
&:hover .copy-code-button {
pointer-events: all;
transform: translateX(0px);
opacity: 0.5;
}
.copy-code-button {
position: absolute;
right: 10px;
cursor: pointer;
padding: 0px 5px;
background-color: var(--black);
color: var(--white);
border: var(--border-in-light);
border-radius: 10px;
transform: translateX(10px);
pointer-events: none;
opacity: 0;
transition: all ease 0.3s;
&:after {
content: "copy";
}
&:hover {
opacity: 1;
}
}
}