Skip to content

Commit

Permalink
refactor: styles of copy button (#14)
Browse files Browse the repository at this point in the history
优化复制按钮的显示方式,修复出现多个滚动条的问题。

/kind bug

Fixes #13 

before:

<img width="500" alt="image" src="https://github.com/halo-sigs/plugin-highlightjs/assets/21301288/7dd6b773-af3c-4857-9d8a-cdb29b594393">

<img width="501" alt="image" src="https://github.com/halo-sigs/plugin-highlightjs/assets/21301288/517ccbc8-38b6-44b4-86ec-285edacfe139">

after:

<img width="503" alt="image" src="https://github.com/halo-sigs/plugin-highlightjs/assets/21301288/658c9d0c-b422-491b-8e46-7abddd5c16da">

```release-note
优化复制按钮的显示方式,修复出现多个滚动条的问题。

```
  • Loading branch information
ruibaby authored Mar 5, 2024
1 parent 5abffdf commit f0adc38
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions src/main/resources/static/plugins/override.css
Original file line number Diff line number Diff line change
@@ -1,3 +1,22 @@
.hljs-copy-button[data-copied="true"] {
padding: 0 0.5em;
}

.hljs-copy-button {
transform: translateX(0) !important;
display: none;
}

.hljs-copy-wrapper:hover .hljs-copy-button,
.hljs-copy-button:focus {
display: block;
}

.hljs-copy-button:hover {
background-color: var(--hljs-theme-background) !important;
filter: brightness(1.1);
}

.hljs-copy-alert {
display: none;
}

0 comments on commit f0adc38

Please sign in to comment.