mirror of
https://github.com/facebook/docusaurus.git
synced 2025-08-05 01:38:52 +02:00
refactor(v2): make better code blocks (#2534)
* refactor(v2): make better code blocks * Update styles.module.css Co-authored-by: Yangshun Tay <tay.yang.shun@gmail.com>
This commit is contained in:
parent
3dfc41bd36
commit
349eee042b
2 changed files with 3 additions and 23 deletions
|
@ -40,16 +40,12 @@
|
|||
padding: 0.4rem 0.5rem;
|
||||
position: absolute;
|
||||
right: var(--ifm-pre-padding);
|
||||
top: var(--ifm-pre-padding);
|
||||
top: calc(var(--ifm-pre-padding) / 2);
|
||||
visibility: hidden;
|
||||
transition: opacity 200ms ease-in-out, visibility 200ms ease-in-out,
|
||||
bottom 200ms ease-in-out;
|
||||
}
|
||||
|
||||
.copyButtonWithTitle {
|
||||
top: calc(var(--ifm-pre-padding));
|
||||
}
|
||||
|
||||
.codeBlockTitle:hover + .codeBlockContent .copyButton,
|
||||
.codeBlockContent:hover > .copyButton {
|
||||
visibility: visible;
|
||||
|
@ -65,9 +61,3 @@
|
|||
min-width: 100%;
|
||||
padding: var(--ifm-pre-padding);
|
||||
}
|
||||
|
||||
/* Disable top border radius when title is present. */
|
||||
.codeBlockTitle + .codeBlockContent .codeBlockLines {
|
||||
border-top-left-radius: 0;
|
||||
border-top-right-radius: 0;
|
||||
}
|
||||
|
|
|
@ -39,17 +39,13 @@
|
|||
outline: none;
|
||||
padding: 0.4rem 0.5rem;
|
||||
position: absolute;
|
||||
right: var(--ifm-pre-padding);
|
||||
top: var(--ifm-pre-padding);
|
||||
right: calc(var(--ifm-pre-padding) / 2);
|
||||
top: calc(var(--ifm-pre-padding) / 2);
|
||||
visibility: hidden;
|
||||
transition: opacity 200ms ease-in-out, visibility 200ms ease-in-out,
|
||||
bottom 200ms ease-in-out;
|
||||
}
|
||||
|
||||
.copyButtonWithTitle {
|
||||
top: calc(var(--ifm-pre-padding));
|
||||
}
|
||||
|
||||
.codeBlockTitle:hover + .codeBlockContent .copyButton,
|
||||
.codeBlockContent:hover > .copyButton {
|
||||
visibility: visible;
|
||||
|
@ -65,9 +61,3 @@
|
|||
min-width: 100%;
|
||||
padding: var(--ifm-pre-padding);
|
||||
}
|
||||
|
||||
/* Disable top border radius when title is present. */
|
||||
.codeBlockTitle + .codeBlockContent .codeBlockLines {
|
||||
border-top-left-radius: 0;
|
||||
border-top-right-radius: 0;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue