Commit 0d24256c4d

0d24256c4d365d9700016b3cb24670b075994627

parent: 216f24bed3

Unsigned

Duck <57977673+woducku@users.noreply.github.com> · 2026-07-04 06:43 UTC

Update BookmarksPanel.vue

Layout: unified · split

docs/.vitepress/theme/components/BookmarksPanel.vue +32 −6
@@ -1,6 +1,6 @@
11<script setup lang="ts">
22import { onClickOutside } from '@vueuse/core'
3import { Bookmark, BookMarked, Hash, X } from 'lucide-vue-next'
3import { Bookmark, Hash, X } from 'lucide-vue-next'
44import { computed, ref } from 'vue'
55import type { DefaultTheme } from 'vitepress/theme'
66import type { HomeCard } from '../../configs/constants'
@@ -147,8 +147,9 @@ const grouped = computed((): GroupEntry[] => {
147147 @scroll.passive="onScroll"
148148 >
149149 <div v-if="bookmarks.length === 0" class="bookmarks-empty">
150 <BookMarked :size="128" :stroke-width="1" class="bookmarks-empty-icon" />
151 <p class="bookmarks-empty-hint">Click the bookmark icon next to any heading in the table of contents to save it here.</p>
150 <span class="bookmarks-empty-kaomoji">(˶ᵔ ᵕ ᵔ˶)</span>
151 <p class="bookmarks-empty-hint bookmarks-empty-hint--desktop">Tip: Hover over any primary heading under <strong>On this page</strong> and click <Bookmark :size="13" :stroke-width="2" class="bookmarks-empty-inline-icon" /> to bookmark it.</p>
152 <p class="bookmarks-empty-hint bookmarks-empty-hint--mobile">Tip: Tap <strong>On this page</strong> and press <Bookmark :size="13" :stroke-width="2" class="bookmarks-empty-inline-icon" /> next to any primary heading to bookmark it.</p>
152153 </div>
153154 <div v-else class="bookmarks-groups">
154155 <template v-for="group in grouped" :key="group.type === 'page' ? group.path : group.section">
@@ -288,9 +289,11 @@ const grouped = computed((): GroupEntry[] => {
288289 overflow: hidden;
289290}
290291
291.bookmarks-empty-icon {
292.bookmarks-empty-kaomoji {
293 font-size: 28px;
292294 color: var(--vp-c-text-3);
293 flex: none;
295 line-height: 1;
296 user-select: none;
294297}
295298
296299.bookmarks-empty-hint {
@@ -303,6 +306,17 @@ const grouped = computed((): GroupEntry[] => {
303306 word-break: break-word;
304307}
305308
309.bookmarks-empty-hint--mobile {
310 display: none;
311}
312
313.bookmarks-empty-inline-icon {
314 display: inline;
315 vertical-align: middle;
316 position: relative;
317 top: -1px;
318}
319
306320.bookmarks-groups {
307321 display: flex;
308322 flex-direction: column;
@@ -437,6 +451,16 @@ const grouped = computed((): GroupEntry[] => {
437451 display: none;
438452}
439453
454@media (max-width: 1279px) {
455 .bookmarks-empty-hint--desktop {
456 display: none;
457 }
458
459 .bookmarks-empty-hint--mobile {
460 display: block;
461 }
462}
463
440464@media (max-width: 767px) {
441465 .bookmarks-panel {
442466 position: fixed;
@@ -458,11 +482,13 @@ const grouped = computed((): GroupEntry[] => {
458482 flex: 1;
459483 height: auto;
460484 min-height: 0;
485 display: flex;
486 flex-direction: column;
461487 }
462488
463489 .bookmarks-empty {
464 min-height: 0;
465490 flex: 1;
491 min-height: 0;
466492 }
467493
468494 .bookmarks-mobile-header {