Skip to content

Commit

Permalink
perf: 代码复制交互优化
Browse files Browse the repository at this point in the history
  • Loading branch information
pengzhanbo committed Dec 22, 2023
1 parent 19dd1f0 commit c9c7bb4
Showing 1 changed file with 16 additions and 5 deletions.
21 changes: 16 additions & 5 deletions packages/plugin-copy-code/src/client/styles/button.scss
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,12 @@
div[class*='language-'] & {
position: absolute;
right: 0;
top: 2rem;
top: 0.8rem;
z-index: 99;
opacity: 0;
transition: opacity var(--t-color);
}

div[class*='language-']:hover & {
opacity: 1;
}

.icon-success {
display: inline-block;
width: 1.5rem;
Expand All @@ -29,6 +25,21 @@
}
}

div[class*='language-'] {
&::before {
opacity: 1;
transition: opacity var(--t-color);
}

&:hover::before {
opacity: 0;
}

&:hover .copy-code-button {
opacity: 1;
}
}

.icon-copy {
display: inline-block;
width: 1.5rem;
Expand Down

0 comments on commit c9c7bb4

Please sign in to comment.