Skip to content

Commit 76ead2b

Browse files
committed
Adds styles fro the copy code to clipboard functionality.
1 parent acb4277 commit 76ead2b

File tree

1 file changed

+50
-1
lines changed

1 file changed

+50
-1
lines changed

styles/courses.css

Lines changed: 50 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -530,4 +530,53 @@ pre code.hljs {
530530
pre code,
531531
pre code.hljs {
532532
display: block;
533-
}
533+
}
534+
535+
pre {
536+
position: relative;
537+
}
538+
539+
.div-copy {
540+
position: absolute;
541+
top: 0;
542+
right: 0;
543+
}
544+
545+
.div-copy .tooltip-copy::after {
546+
content: "";
547+
position: absolute;
548+
right: 100%;
549+
margin-right: -4px;
550+
top: 60%;
551+
transform: translateY(-50%);
552+
border-style: solid;
553+
border-width: 2px 2px 5px 8px;
554+
border-color: transparent transparent transparent #444;
555+
opacity: 0;
556+
transition: opacity .3s;
557+
}
558+
559+
.div-copy .tooltip-copy::before {
560+
content: "Copied";
561+
position: absolute;
562+
top: 60%;
563+
transform: translateY(-50%);
564+
right: 100%;
565+
margin-right: 5px;
566+
padding: 2px 7px;
567+
border-radius: 5px;
568+
background: #444;
569+
color: #fff;
570+
text-align: center;
571+
opacity: 0;
572+
transition: opacity .3s;
573+
}
574+
575+
.div-copy .tooltip-copy {
576+
margin-right: 0.3em;
577+
margin-top: 0.3em;
578+
}
579+
580+
.div-copy.clicked .tooltip-copy::before, .div-copy.clicked .tooltip-copy::after {
581+
opacity: 1;
582+
}

0 commit comments

Comments
 (0)