1
0
mirror of https://github.com/cotes2020/jekyll-theme-chirpy.git synced 2026-06-21 23:38:39 +00:00

refactor(ui): reduce the size of the 'close' and 'copy' buttons

- The close button in the TOC popup
- The copy button in the code block
This commit is contained in:
Cotes Chung
2026-06-20 20:23:33 +08:00
parent 5cc9dc66ac
commit 18cf79bdac
4 changed files with 7 additions and 9 deletions
@@ -62,6 +62,7 @@ export class TocMobile {
static showPopup() { static showPopup() {
this.lockScroll(true); this.lockScroll(true);
$popup.showModal(); $popup.showModal();
$btnClose.blur();
const activeItem = $popup.querySelector('li.is-active-li'); const activeItem = $popup.querySelector('li.is-active-li');
activeItem.scrollIntoView({ block: 'center' }); activeItem.scrollIntoView({ block: 'center' });
} }
+1 -3
View File
@@ -113,9 +113,7 @@ script_includes:
<dialog id="toc-popup" class="p-0"> <dialog id="toc-popup" class="p-0">
<div class="header d-flex flex-row align-items-center justify-content-between"> <div class="header d-flex flex-row align-items-center justify-content-between">
<div class="label text-truncate py-2 ms-4">{{- page.title -}}</div> <div class="label text-truncate py-2 ms-4">{{- page.title -}}</div>
<button id="toc-popup-close" type="button" class="btn mx-1 my-1 opacity-75"> <button id="toc-popup-close" type="button" class="btn-close btn-sm mx-3" aria-label="Close"></button>
<i class="fas fa-close"></i>
</button>
</div> </div>
<div id="toc-popup-content" class="px-4 py-3 pb-4"></div> <div id="toc-popup-content" class="px-4 py-3 pb-4"></div>
</dialog> </dialog>
+4 -2
View File
@@ -219,8 +219,9 @@ div {
@extend %rounded; @extend %rounded;
border: 1px solid transparent; border: 1px solid transparent;
height: v.$code-header-height; height: 2rem;
width: v.$code-header-height; width: 2rem;
margin-right: 0.125rem;
padding: 0; padding: 0;
background-color: inherit; background-color: inherit;
@@ -234,6 +235,7 @@ div {
} }
i { i {
font-size: 90%;
color: var(--clipboard-checked-color); color: var(--clipboard-checked-color);
} }
} }
+1 -4
View File
@@ -93,10 +93,7 @@
} }
button { button {
> i { font-size: 0.75rem;
font-size: 1.25rem;
vertical-align: middle;
}
&:focus-visible { &:focus-visible {
box-shadow: none; box-shadow: none;