feat: Copy Code

This commit is contained in:
shenyu
2020-04-12 21:17:46 +08:00
parent 84f7538acd
commit 586f38c9ed
5 changed files with 101 additions and 2 deletions

35
source/css/clipboard.styl Normal file
View File

@@ -0,0 +1,35 @@
//
if hexo-config('copy_btn') == true
.highlight
position: relative
.btn-copy
z-index: 1
display: inline-block
cursor: pointer
border: none
disable-user-select()
-webkit-appearance: none
font-size: 12px
font-weight: bold
padding: 3px 6px
>i
margin-right: 4px
font-size: 10px
transform: translateY(1px);
color: #333
background: rgba(255,255,255,.8)
border-radius: 2px
position: absolute
top: 0
right: 0
opacity: 0
transition: all linear .2s
&:hover
background: rgba(255,255,255,.7)
.highlight:hover .btn-copy
opacity: 1
.article pre:hover .btn-copy
opacity: 1