fix(v2): make code blocks scrollable (#2241)

* wip

* fix(v2): make code blocks scrollable

Co-authored-by: Yangshun Tay <tay.yang.shun@gmail.com>
This commit is contained in:
Alexey Pyltsyn 2020-02-08 14:44:45 +03:00 committed by GitHub
parent 0fa080c39c
commit bb82d0e073
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 86 additions and 63 deletions

View file

@ -6,19 +6,10 @@
*/
.codeBlock {
margin-bottom: 0;
overflow: hidden;
overflow-wrap: break-word;
white-space: pre-wrap;
}
.codeBlockWrapper {
position: relative;
}
.codeBlockWrapper:hover > .copyButton {
visibility: visible;
opacity: 1;
overflow: auto;
display: block;
padding: 0;
margin: 0;
}
.copyButton {
@ -38,3 +29,17 @@
transition: opacity 200ms ease-in-out, visibility 200ms ease-in-out,
bottom 200ms ease-in-out;
}
.codeBlock:hover > .copyButton {
visibility: visible;
opacity: 1;
}
.codeBlockLines {
background-color: transparent;
border-radius: 0;
margin-bottom: 0;
float: left;
min-width: 100%;
padding: var(--ifm-pre-padding);
}