mirror of
https://github.com/facebook/docusaurus.git
synced 2025-08-06 10:20:09 +02:00
feat(v2): CodeBlock copy button (#1643)
* feat(v2): CodeBlock copy button * fix: live theme editor breaking bug
This commit is contained in:
parent
4faa608edd
commit
7b7d1e6161
7 changed files with 164 additions and 21 deletions
|
@ -6,3 +6,31 @@
|
|||
overflow-wrap: break-word;
|
||||
white-space: pre-wrap;
|
||||
}
|
||||
|
||||
.codeBlockWrapper {
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.codeBlockWrapper:hover > .copyButton {
|
||||
bottom: calc(var(--ifm-pre-padding) - 2px);
|
||||
visibility: visible;
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
.copyButton {
|
||||
position: absolute;
|
||||
right: var(--ifm-pre-padding);
|
||||
bottom: calc(var(--ifm-pre-padding) - 4px);
|
||||
padding: 4px 8px;
|
||||
visibility: hidden;
|
||||
opacity: 0;
|
||||
transition: opacity 200ms ease-in-out, visibility 200ms ease-in-out,
|
||||
bottom 200ms ease-in-out;
|
||||
border: 1px solid rgb(214, 222, 235);
|
||||
border-radius: var(--ifm-global-radius);
|
||||
outline: none;
|
||||
cursor: pointer;
|
||||
line-height: 12px;
|
||||
background: rgb(1, 22, 39);
|
||||
color: rgb(214, 222, 235);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue