Skip to content

Commit b4a65ee

Browse files
angelikatyborskajosevalim
authored andcommitted
Make copy button more visibel over text
1 parent dd0fc3c commit b4a65ee

File tree

1 file changed

+13
-7
lines changed

1 file changed

+13
-7
lines changed

assets/css/copy-button.css

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,27 +2,33 @@ pre {
22
position: relative;
33
}
44

5-
pre:hover .copy-button {
6-
opacity: .5;
5+
pre:hover .copy-button, pre .copy-button:focus {
6+
opacity: 1;
77
}
88

99
.copy-button {
10+
display: flex;
1011
opacity: 0;
1112
position: absolute;
12-
top: 9px;
13-
right: 9px;
14-
background-color: transparent;
13+
top: 5px;
14+
right: 5px;
15+
padding: 4px;
16+
background-color: var(--codeBackground);
1517
border: none;
1618
cursor: pointer;
17-
padding: 0;
1819
transition: all 150ms;
1920
font-family: var(--serifFontFamily);
2021
font-size: 14px;
2122
line-height: 24px;
2223
color: currentColor;
2324
}
2425

25-
pre .copy-button:hover, pre .copy-button:focus-visible {
26+
.copy-button svg {
27+
opacity: .5;
28+
transition: all 150ms;
29+
}
30+
31+
pre .copy-button:hover svg, pre .copy-button:focus-visible svg {
2632
opacity: 1;
2733
}
2834

0 commit comments

Comments
 (0)