diff --git a/source/css/layout/common/codeblock/copy-code.styl b/source/css/layout/common/codeblock/copy-code.styl new file mode 100644 index 0000000..8f94d4e --- /dev/null +++ b/source/css/layout/common/codeblock/copy-code.styl @@ -0,0 +1,74 @@ +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(); + + if (hexo-config('codeblock.style') == 'flat') { + background: white; + border: 0; + font-size: 0.8em; + right: 0; + top: 0; + } else if (hexo-config('codeblock.style') == 'mac') { + 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; + } +} + + +if (hexo-config('codeblock.style') == 'mac') { + .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; + } + } +}