[opt] style

This commit is contained in:
xaoxuu 2024-01-12 13:26:13 +08:00
parent 2ed4d21472
commit 07a532b262
4 changed files with 23 additions and 17 deletions

View File

@ -60,6 +60,8 @@ details.folding[child=codeblock]>div.body
margin: 0 margin: 0
figcaption figcaption
display: none display: none
span
background: var(--theme-block)
.code:before .code:before
content: none content: none
.highlight+.highlight .highlight+.highlight

View File

@ -40,6 +40,9 @@
margin: 0 margin: 0
border: none border: none
background: none background: none
figcaption
span
background: var(--theme-block)
.highlight+.highlight .highlight+.highlight
border-top: 1px dashed var(--theme-border) border-top: 1px dashed var(--theme-border)
border-top-left-radius: 0 border-top-left-radius: 0

View File

@ -5,35 +5,36 @@
position: absolute position: absolute
top: 0 top: 0
right: 0 right: 0
padding: 4px 0.5rem padding: 0px 0.5rem
opacity: 0
font-weight: 700 font-weight: 700
color: var(--text-p2) visibility: hidden
border-bottom-left-radius: $border-bar border-bottom-left-radius: $border-bar
border-bottom-right-radius: $border-bar border-bottom-right-radius: $border-bar
background: var(--block-hover) background: var(--card)
display: block display: block
cursor: pointer cursor: pointer
margin-right: 0.5rem margin-right: 4px
margin-top: 4px
border-radius: 'calc(%s - 4px)' % $border-block
.highlight:hover .highlight:hover
.code:before .code:before
opacity: 0 visibility: hidden
.copy-btn .copy-btn
opacity: 0.75 visibility: visible
.highlight .code .copy-btn:hover
opacity: 1
.highlight .code .copy-btn.success .highlight .code .copy-btn.success
color: $c-green background: $c-green
opacity: 0.75 color: white
visibility: visible
.highlight .code .copy-btn.warning .highlight .code .copy-btn.warning
color: $c-orange background: $c-orange
opacity: 0.75 color: white
visibility: visible
.md-text .folding[child=codeblock] .md-text .folding[child=codeblock]
.highlight .code .copy-btn .code .copy-btn
margin-top: 1rem z-index 1
margin-right: 1rem
border-radius: $border-bar border-radius: $border-bar

View File

@ -13,7 +13,7 @@ codeElementArr.forEach(code => {
codeCopyBtn.innerText = stellar.plugins.copycode.success_text codeCopyBtn.innerText = stellar.plugins.copycode.success_text
codeCopyBtn.classList.add('success') codeCopyBtn.classList.add('success')
hud.toast(stellar.plugins.copycode.toast) hud.toast(stellar.plugins.copycode.toast, 2500)
setTimeout(() => { setTimeout(() => {
codeCopyBtn.innerText = stellar.plugins.copycode.default_text codeCopyBtn.innerText = stellar.plugins.copycode.default_text
codeCopyBtn.classList.remove('success') codeCopyBtn.classList.remove('success')