Only show codeblock copy icon on hover

Fixes #980
This commit is contained in:
Dan Brown 2018-09-22 14:55:33 +01:00
parent 50ee1462ad
commit a441faf65c
No known key found for this signature in database
GPG Key ID: 46D9F943C24A2EF9
2 changed files with 6 additions and 4 deletions

View File

@ -113,7 +113,7 @@ function addCopyIcon(cmInstance) {
copyButton.classList.add('success');
setTimeout(() => {
copyButton.classList.remove('success');
}, 360);
}, 240);
});
}

View File

@ -419,11 +419,12 @@ span.CodeMirror-selectedtext { background: none; }
cursor: pointer;
fill: #444;
z-index: 5;
transition: all ease-in 180ms;
transition: all ease-in 240ms;
user-select: none;
opacity: 0.7;
opacity: 0;
pointer-events: none;
svg {
transition: transform ease-in 180ms;
transition: transform ease-in 240ms;
transform: translateY(0);
}
&.success {
@ -437,4 +438,5 @@ span.CodeMirror-selectedtext { background: none; }
.CodeMirror:hover .CodeMirror-copy {
user-select: all;
opacity: 1;
pointer-events: all;
}