hexo-theme-keep/source/css/layout/common/codeblock/copy-code.styl

66 lines
1.2 KiB
Stylus
Raw Normal View History

2020-04-18 17:29:10 +08:00
disable-user-select() {
-moz-user-select: none;
-ms-user-select: none;
-webkit-user-select: none;
user-select: none;
}
.highlight-container {
position: relative;
}
.highlight-container:hover .copy-btn, .highlight-container .copy-btn:focus {
opacity: 1;
}
.copy-btn {
2020-11-18 11:56:47 +08:00
color: var(--default-text-color);
2020-04-18 17:29:10 +08:00
cursor: pointer;
display: inline-block;
font-weight: bold;
2020-12-01 16:51:38 +08:00
line-height: 1.8;
2020-04-18 17:29:10 +08:00
opacity: 0;
outline: 0;
padding: 2px 6px;
position: absolute;
vertical-align: middle;
white-space: nowrap;
2020-12-01 16:51:38 +08:00
font-size: 1.08rem;
2020-04-18 17:29:10 +08:00
disable-user-select();
the-transition();
2020-11-18 11:56:47 +08:00
if (hexo-config('code_copy.style') == 'mac') {
2020-04-18 17:29:10 +08:00
color: white;
right: 2px;
top: 2px;
} else {
2020-11-18 11:56:47 +08:00
background: var(--background-color);
border: 0;
right: 0;
top: 0;
2020-04-18 17:29:10 +08:00
}
}
2020-04-30 12:24:57 +08:00
if (hexo-config('code_copy.style') == 'mac') {
2020-04-18 17:29:10 +08:00
.highlight-container {
background: #21252b;
border-radius: 5px;
box-shadow: 0 10px 30px 0 rgba(0, 0, 0, .4);
padding-top: 20px;
margin-top: 10px;
&::before {
background: #fc625d;
border-radius: 50%;
box-shadow: 20px 0 #fdbc40, 40px 0 #35cd4b;
content: ' ';
height: 12px;
left: 12px;
margin-top: -10px;
position: absolute;
width: 12px;
}
}
}