forked from webpack/webpack.js.org
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCodeBlockWithCopy.scss
More file actions
74 lines (60 loc) · 1.06 KB
/
CodeBlockWithCopy.scss
File metadata and controls
74 lines (60 loc) · 1.06 KB
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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
.code-block-wrapper {
position: relative;
margin-bottom: 1.5rem;
}
.code-block {
background-color: #2d3748;
color: #e2e8f0;
padding: 1rem;
padding-right: 3.5rem;
border-radius: 0.5rem;
overflow-x: auto;
font-size: 0.875rem;
line-height: 1.5;
box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
code {
font-family: monospace;
}
}
.copy-button {
position: absolute;
top: 0.6rem;
right: 0.5rem;
z-index: 10;
padding: 0.4rem 0.7rem;
border-radius: 0.35rem;
border: none;
cursor: pointer;
font-size: 0.75rem;
font-weight: 500;
/* Always visible */
opacity: 1;
background-color: #175d96;
color: #e2e8f0;
transition:
background-color 0.2s,
transform 0.1s;
&:hover {
background-color: #2f85d0;
}
/* Success */
&.copied {
background-color: #38a169;
}
&.copied:hover {
background-color: #2f855a;
}
/* Error */
&.error {
background-color: #e53e3e;
}
&.error:hover {
background-color: #c53030;
}
&:focus {
outline: none;
}
&:active {
transform: scale(0.95);
}
}