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:
scheinriese
2025-11-28 20:51:50 +01:00
parent 2ceb5e8ff6
commit 4e269f6444
2 changed files with 3 additions and 3 deletions

View File

@@ -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)

View File

@@ -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)))