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

75 lines
1.5 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 {
color: #333;
cursor: pointer;
display: inline-block;
font-weight: bold;
line-height: 1.6;
opacity: 0;
outline: 0;
padding: 2px 6px;
position: absolute;
vertical-align: middle;
white-space: nowrap;
disable-user-select();
the-transition();
2020-04-30 12:24:57 +08:00
if (hexo-config('code_copy.style') == 'flat') {
2020-04-18 17:29:10 +08:00
background: white;
border: 0;
font-size: 0.8em;
right: 0;
top: 0;
2020-04-30 12:24:57 +08:00
} else if (hexo-config('code_copy.style') == 'mac') {
2020-04-18 17:29:10 +08:00
color: white;
font-size: 1em;
right: 2px;
top: 2px;
} else {
background-color: #eee;
background-image: linear-gradient(#fcfcfc, #eee);
border: 1px solid #d5d5d5;
border-radius: 3px;
font-size: 0.8em;
right: 6px;
top: 6px;
}
}
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;
}
}
}