mirror of
https://github.com/Dichgrem/Blog.git
synced 2026-02-04 17:11:57 -05:00
feat:copy_button
This commit is contained in:
32
sass/copy.scss
Normal file
32
sass/copy.scss
Normal file
@@ -0,0 +1,32 @@
|
||||
.copy-button {
|
||||
position: absolute;
|
||||
top: 8px;
|
||||
right: 8px;
|
||||
padding: 4px 10px;
|
||||
font-size: 0.8rem;
|
||||
font-family: DejaVu Sans Mono, Monaco, Consolas, Ubuntu Mono, monospace;
|
||||
background: var(--accent);
|
||||
color: var(--background);
|
||||
border: none;
|
||||
border-radius: 3px;
|
||||
cursor: pointer;
|
||||
opacity: 0;
|
||||
transition: opacity 0.2s ease;
|
||||
z-index: 1;
|
||||
|
||||
&:hover {
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
&.copied {
|
||||
background: #4caf50;
|
||||
}
|
||||
}
|
||||
|
||||
pre:hover .copy-button {
|
||||
opacity: 0.8;
|
||||
}
|
||||
|
||||
pre:hover .copy-button:hover {
|
||||
opacity: 1;
|
||||
}
|
||||
Reference in New Issue
Block a user