|
1 | 1 | <script> |
2 | 2 | import { createEventDispatcher } from 'svelte'; |
| 3 | + import SearchLogo from './SearchLogo.svelte'; |
3 | 4 |
|
4 | 5 | /** @type {import('./types').Tree[]} */ |
5 | 6 | export let results; |
|
36 | 37 | escape(suffix) |
37 | 38 | ); |
38 | 39 | } |
| 40 | +
|
| 41 | + /** |
| 42 | + * @param {string} title |
| 43 | + */ |
| 44 | + function removeType(title) { |
| 45 | + return title.split('/').at(-1); |
| 46 | + } |
39 | 47 | </script> |
40 | 48 |
|
41 | 49 | <ul> |
42 | 50 | {#each results as result (result.href)} |
43 | | - <li> |
| 51 | + <li class="bcu-card variant-ghost px-2"> |
44 | 52 | <a |
45 | 53 | class="!no-underline !text-token" |
46 | 54 | data-sveltekit-preload-data |
47 | 55 | href={result.href} |
48 | 56 | on:click={() => dispatch('select', { href: result.href })} |
49 | 57 | data-has-node={result.node ? true : undefined} |
50 | 58 | > |
51 | | - <strong>{@html excerpt(result.breadcrumbs[result.breadcrumbs.length - 1], query)}</strong> |
52 | | - |
53 | | - {#if result.node?.content} |
54 | | - <span>{@html excerpt(result.node.content, query)}</span> |
55 | | - {/if} |
| 59 | + <div class="flex gap-2 md:gap-8"> |
| 60 | + <SearchLogo breadcrumb={result.breadcrumbs[result.breadcrumbs.length - 1]} /> |
| 61 | + <div> |
| 62 | + <strong |
| 63 | + >{@html excerpt( |
| 64 | + removeType(result.breadcrumbs[result.breadcrumbs.length - 1]) || '', |
| 65 | + query |
| 66 | + )} |
| 67 | + </strong> |
| 68 | + {#if result.node?.content} |
| 69 | + <span>{@html excerpt(result.node.content, query)}</span> |
| 70 | + {/if} |
| 71 | + </div> |
| 72 | + </div> |
56 | 73 | </a> |
57 | 74 |
|
58 | 75 | {#if result.children.length > 0} |
|
125 | 142 | } |
126 | 143 |
|
127 | 144 | a :global(mark) { |
128 | | - --highlight-color: rgba(255, 255, 0, 0.2); |
| 145 | + --highlight-color: rgba(var(--color-primary-500) / 1); |
129 | 146 | } |
130 | 147 |
|
131 | 148 | a span :global(mark) { |
132 | 149 | background: none; |
133 | | - color: var(--sk-text-1); |
| 150 | + color: rgb(var(--on-primary)); |
134 | 151 | background: var(--highlight-color); |
135 | 152 | outline: 2px solid var(--highlight-color); |
136 | 153 | border-top: 2px solid var(--highlight-color); |
|
0 commit comments