mirror of
https://github.com/logseq/logseq.git
synced 2026-02-01 22:47:36 +00:00
Refactor highlight rendering in search and cmdk components
- Replaced the use of `:mark` elements with `:span` elements for highlighted text in both search and cmdk components, applying a unified CSS class for consistent styling. - Improved the visual coherence of highlighted items across the application.
This commit is contained in:
@@ -282,7 +282,7 @@
|
||||
result []]
|
||||
(let [[b-cut hl-cut e-cut] (text-util/cut-by content "$pfts_2lqh>$" "$<pfts_2lqh$")
|
||||
hiccups-add [[:span b-cut]
|
||||
[:mark.p-0.rounded-none hl-cut]]
|
||||
[:span {:class "ui__list-item-highlighted-span"} hl-cut]]
|
||||
hiccups-add (remove nil? hiccups-add)
|
||||
new-result (concat result hiccups-add)]
|
||||
(if-not (string/blank? e-cut)
|
||||
|
||||
@@ -135,7 +135,7 @@
|
||||
[:div
|
||||
(when-not (string/blank? before)
|
||||
[:span before])
|
||||
[:mark.p-0.rounded-none (subs content i (+ i (count q)))]
|
||||
[:span {:class "ui__list-item-highlighted-span"} (subs content i (+ i (count q)))]
|
||||
(when-not (string/blank? after)
|
||||
[:span after])])
|
||||
(let [elements (loop [words q-words
|
||||
@@ -151,7 +151,7 @@
|
||||
(vec
|
||||
(concat result
|
||||
[[:span (subs content 0 i)]
|
||||
[:mark.p-0.rounded-none (subs content i (+ i (count word)))]])))
|
||||
[:span {:class "ui__list-item-highlighted-span"} (subs content i (+ i (count word)))]])))
|
||||
(recur nil
|
||||
content
|
||||
result)))
|
||||
|
||||
Reference in New Issue
Block a user