forked from Automattic/mongoose
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcopy-code.css
More file actions
43 lines (36 loc) · 876 Bytes
/
copy-code.css
File metadata and controls
43 lines (36 loc) · 876 Bytes
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
/* Base button placement & visibility */
.copy-btn {
position: absolute;
top: 6px;
right: 6px;
background: transparent;
border: none;
padding: 4px;
cursor: pointer;
opacity: 0;
transform: translateY(-3px);
transition: opacity 0.18s ease, transform 0.18s ease, color 0.2s ease;
display: flex;
align-items: center;
justify-content: center;
color: #666; /* default icon color */
}
/* Show button only when the code block is hovered */
pre:hover .copy-btn {
opacity: 1;
transform: translateY(0);
}
/* Hover state always forces black — applies to both icons */
.copy-btn:hover {
color: #000 !important;
}
/* Tick icon uses the same neutral grey so hover can override cleanly */
.copy-btn.copied {
color: #666;
}
/* Icon sizing + smooth color transition */
.copy-btn svg {
width: 20px;
height: 20px;
transition: color 0.2s ease;
}