Skip to content

Commit

Permalink
Double flex
Browse files Browse the repository at this point in the history
  • Loading branch information
eyeseast committed Apr 22, 2024
1 parent 61725c4 commit c0acaea
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 14 deletions.
11 changes: 10 additions & 1 deletion src/lib/components/documents/NoteHighlights.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,16 @@
<style>
h4 :global(em),
.segment :global(em) {
background-color: var(--yellow);
background-color: var(--yellow-bright);
font-style: normal;
}
blockquote {
border-left: 0.25rem solid var(--yellow-bright);
padding-left: 0.5rem;
}
cite {
font-size: var(--font-s);
}
</style>
23 changes: 13 additions & 10 deletions src/lib/components/documents/ResultsList.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -88,16 +88,19 @@

<div class="container">
{#each results as document (document.id)}
<Flex gap={0.625} align="center">
<label>
<span class="sr-only">Select</span>
<input
type="checkbox"
bind:group={$selected}
value={String(document.id)}
/>
</label>
<DocumentListItem {document} />
<Flex direction="column">
<Flex gap={0.625} align="center">
<label>
<span class="sr-only">Select</span>
<input
type="checkbox"
bind:group={$selected}
value={String(document.id)}
/>
</label>
<DocumentListItem {document} />
</Flex>

{#if document.highlights}
<SearchHighlights {document} />
{/if}
Expand Down
2 changes: 1 addition & 1 deletion src/lib/components/documents/SearchHighlights.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@

<style>
.segment :global(em) {
background-color: var(--yellow);
background-color: var(--yellow-bright);
font-style: normal;
}
</style>
11 changes: 9 additions & 2 deletions src/lib/components/documents/stories/ResultsList.stories.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,12 @@
// typescript complains without the type assertion
import searchResults from "$lib/api/fixtures/documents/search-highlight.json";
const results = searchResults.results as Document[];
const highlighted = searchResults.results as Document[];
const results = highlighted.map((d) => ({
...d,
highlights: null,
note_highlights: null,
}));
const count = searchResults.count;
const next = searchResults.next;
Expand All @@ -31,5 +36,7 @@
</Story>

<Story name="Highlighted">
<div style="width: 36rem"><ResultsList {results} {count} {next} /></div>
<div style="width: 36rem">
<ResultsList results={highlighted} {count} {next} />
</div>
</Story>
4 changes: 4 additions & 0 deletions src/style/kit.css
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,10 @@ dd {
font-weight: var(--font-regular, 400);
}

summary {
cursor: pointer;
}

/*
Utility classes
*/
Expand Down

0 comments on commit c0acaea

Please sign in to comment.