From 620b57bfa6eb08a487dd881d455efdab8c220583 Mon Sep 17 00:00:00 2001 From: Adorian Doran Date: Wed, 27 Aug 2025 02:49:48 +0300 Subject: [PATCH] style/quick search results: refactor --- apps/client/src/stylesheets/style.css | 8 -------- apps/client/src/stylesheets/theme-next/shell.css | 10 ++++++---- apps/client/src/widgets/quick_search.ts | 8 ++++++++ 3 files changed, 14 insertions(+), 12 deletions(-) diff --git a/apps/client/src/stylesheets/style.css b/apps/client/src/stylesheets/style.css index 5b679cf53..a8a130341 100644 --- a/apps/client/src/stylesheets/style.css +++ b/apps/client/src/stylesheets/style.css @@ -2349,14 +2349,6 @@ footer.webview-footer button { padding: 1px 10px 1px 10px; } -/* Search result highlighting */ -.search-result-title b, -.search-result-content b, -.search-result-attributes b { - color: var(--admonition-warning-accent-color); - text-decoration: underline; -} - /* Customized icons */ .bx-tn-toc::before { diff --git a/apps/client/src/stylesheets/theme-next/shell.css b/apps/client/src/stylesheets/theme-next/shell.css index 7f8c692f6..ff3fd5e9e 100644 --- a/apps/client/src/stylesheets/theme-next/shell.css +++ b/apps/client/src/stylesheets/theme-next/shell.css @@ -586,6 +586,10 @@ div.quick-search .search-button.show { top: 1px; } +.quick-search .quick-search-item-icon { + vertical-align: text-bottom; +} + /* Note title */ .quick-search .dropdown-menu .dropdown-item > a { color: var(--menu-text-color); @@ -604,15 +608,13 @@ div.quick-search .search-button.show { overflow: hidden; } -.quick-search .quick-search-item-icon { - vertical-align: text-bottom; -} - +/* Note content snippet */ :root .quick-search .search-result-content { background-color: var(--quick-search-result-content-background); border-radius: 4px; } +/* Divider line */ .quick-search .dropdown-item::after { display: none; } diff --git a/apps/client/src/widgets/quick_search.ts b/apps/client/src/widgets/quick_search.ts index ea2df5f46..74124aff4 100644 --- a/apps/client/src/widgets/quick_search.ts +++ b/apps/client/src/widgets/quick_search.ts @@ -98,6 +98,14 @@ const TPL = /*html*/` font-size: .85em; } + /* Search result highlighting */ + .quick-search .search-result-title b, + .quick-search .search-result-content b, + .quick-search .search-result-attributes b { + color: var(--admonition-warning-accent-color); + text-decoration: underline; + } + .quick-search .dropdown-divider { margin: 0; }