Skip to content

Commit

Permalink
[opt] style
Browse files Browse the repository at this point in the history
  • Loading branch information
xaoxuu committed Jan 12, 2024
1 parent 2ed4d21 commit 07a532b
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 17 deletions.
2 changes: 2 additions & 0 deletions source/css/_layout/tag-plugins/folding.styl
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@ details.folding[child=codeblock]>div.body
margin: 0
figcaption
display: none
span
background: var(--theme-block)
.code:before
content: none
.highlight+.highlight
Expand Down
3 changes: 3 additions & 0 deletions source/css/_layout/tag-plugins/note.styl
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@
margin: 0
border: none
background: none
figcaption
span
background: var(--theme-block)
.highlight+.highlight
border-top: 1px dashed var(--theme-border)
border-top-left-radius: 0
Expand Down
33 changes: 17 additions & 16 deletions source/css/_plugins/copycode.styl
Original file line number Diff line number Diff line change
Expand Up @@ -5,35 +5,36 @@
position: absolute
top: 0
right: 0
padding: 4px 0.5rem
opacity: 0
padding: 0px 0.5rem
font-weight: 700
color: var(--text-p2)
visibility: hidden
border-bottom-left-radius: $border-bar
border-bottom-right-radius: $border-bar
background: var(--block-hover)
background: var(--card)
display: block
cursor: pointer
margin-right: 0.5rem
margin-right: 4px
margin-top: 4px
border-radius: 'calc(%s - 4px)' % $border-block

.highlight:hover
.code:before
opacity: 0
visibility: hidden
.copy-btn
opacity: 0.75

.highlight .code .copy-btn:hover
opacity: 1
visibility: visible

.highlight .code .copy-btn.success
color: $c-green
opacity: 0.75
background: $c-green
color: white
visibility: visible

.highlight .code .copy-btn.warning
color: $c-orange
opacity: 0.75
background: $c-orange
color: white
visibility: visible

.md-text .folding[child=codeblock]
.highlight .code .copy-btn
margin-top: 1rem
.code .copy-btn
z-index 1
margin-right: 1rem
border-radius: $border-bar
2 changes: 1 addition & 1 deletion source/js/plugins/copycode.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ codeElementArr.forEach(code => {

codeCopyBtn.innerText = stellar.plugins.copycode.success_text
codeCopyBtn.classList.add('success')
hud.toast(stellar.plugins.copycode.toast)
hud.toast(stellar.plugins.copycode.toast, 2500)
setTimeout(() => {
codeCopyBtn.innerText = stellar.plugins.copycode.default_text
codeCopyBtn.classList.remove('success')
Expand Down

0 comments on commit 07a532b

Please sign in to comment.