Skip to content

Commit 9448a46

Browse files
committed
fix: codeblock COPY position
1 parent 3932f96 commit 9448a46

File tree

1 file changed

+45
-33
lines changed

1 file changed

+45
-33
lines changed

src/components/ui/code-highlighter/CodeHighlighter.module.css

+45-33
Original file line numberDiff line numberDiff line change
@@ -6,41 +6,53 @@
66

77
background: transparent !important;
88
}
9-
}
109

11-
.copy-tip {
12-
position: absolute;
13-
right: 2em;
14-
top: 4em;
15-
opacity: 0.4;
16-
font-size: 0.6em;
17-
font-weight: 600;
18-
text-transform: uppercase;
19-
cursor: pointer;
20-
transition: opacity 0.5s;
21-
will-change: opacity;
22-
user-select: none;
10+
& {
11+
&:hover .copy-tip {
12+
opacity: 0.4;
13+
visibility: visible;
14+
}
2315

24-
&:hover {
25-
opacity: 1;
26-
}
16+
.copy-tip {
17+
position: absolute;
18+
right: 2em;
19+
top: 3em;
20+
opacity: 0.4;
21+
font-size: 0.6em;
22+
font-weight: 600;
23+
text-transform: uppercase;
24+
cursor: pointer;
25+
transition: opacity 0.5s;
26+
will-change: opacity;
27+
user-select: none;
28+
opacity: 0;
29+
visibility: hidden;
30+
transition:
31+
opacity 0.3s ease-in-out,
32+
visibility 0.3s ease-in-out;
2733

28-
&::after {
29-
content: '';
30-
bottom: -3px;
31-
position: absolute;
32-
left: 3px;
33-
right: 3px;
34-
height: 1px;
35-
background-color: currentColor;
36-
}
37-
}
34+
&:hover {
35+
opacity: 1;
36+
}
37+
38+
&::after {
39+
content: '';
40+
bottom: -3px;
41+
position: absolute;
42+
left: 3px;
43+
right: 3px;
44+
height: 1px;
45+
background-color: currentColor;
46+
}
47+
}
3848

39-
.language-tip {
40-
position: absolute;
41-
right: 1em;
42-
transform: translate(-0.5em, 1.2em);
43-
font-size: 0.8em;
44-
opacity: 0.7;
45-
z-index: 1;
49+
.language-tip {
50+
position: absolute;
51+
right: 1em;
52+
transform: translate(-0.5em, 0.5em);
53+
font-size: 0.8em;
54+
opacity: 0.7;
55+
z-index: 1;
56+
}
57+
}
4658
}

0 commit comments

Comments
 (0)