Skip to content

Commit 6bd99d1

Browse files
committed
fix fallback search results page
1 parent f0741c2 commit 6bd99d1

File tree

5 files changed

+23
-18
lines changed

5 files changed

+23
-18
lines changed

apps/svelte.dev/src/routes/+layout.svelte

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,7 @@
2525
{#snippet top_nav()}
2626
<Nav title={data.nav_title} links={data.nav_links}>
2727
{#snippet search()}
28-
{#if $page.url.pathname !== '/search'}
29-
<Search />
30-
{/if}
28+
<Search />
3129
{/snippet}
3230

3331
{#snippet external_links()}

apps/svelte.dev/src/routes/search/+page.svelte

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
</svelte:head>
1010

1111
<main>
12-
<h1>Search</h1>
1312
<form>
1413
<input
1514
name="q"
@@ -26,30 +25,31 @@
2625

2726
<style>
2827
main {
29-
max-width: 48rem;
28+
--padding: 1rem;
29+
max-width: 64rem;
3030
margin: 0 auto;
3131
padding: 8rem 1rem;
32+
font-family: var(--sk-font-ui);
3233
}
3334
3435
form {
35-
--size: 4rem;
36+
--size: 2rem;
3637
position: relative;
3738
width: 100%;
38-
height: var(--size);
39-
margin: 0 0 2em 0;
39+
margin: 0 0 2rem 0;
4040
}
4141
4242
input {
4343
display: block;
4444
width: 100%;
4545
height: 100%;
4646
font-family: inherit;
47-
font-size: inherit;
48-
border: 1px solid var(--sk-back-5);
47+
font-size: var(--sk-text-xl);
48+
border: none;
49+
/* border: 1px solid var(--sk-back-5); */
4950
border-radius: var(--sk-border-radius);
50-
padding-left: var(--size);
51-
border-radius: var(--size);
52-
background: no-repeat 1rem 50% / 2rem 2rem url(/icons/search.svg);
51+
padding: 2rem 2rem 2rem 5rem;
52+
background: no-repeat 1rem 50% / 3rem 3rem url(/icons/search.svg);
5353
color: var(--sk-text-1);
5454
}
5555
</style>

packages/site-kit/src/lib/actions/focus.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
export function focusable_children(node: HTMLElement) {
22
const nodes: HTMLElement[] = Array.from(
33
node.querySelectorAll(
4-
'a[href], button, input, textarea, select, [tabindex]:not([tabindex="-1"])'
4+
'a[href], button, input, textarea, select, summary, [tabindex]:not([tabindex="-1"])'
55
)
66
);
77

packages/site-kit/src/lib/search/SearchBox.svelte

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -278,6 +278,7 @@ It appears when the user clicks on the `Search` component or presses the corresp
278278
279279
.search-box {
280280
--padding: 1rem;
281+
--background: var(--sk-back-2);
281282
position: relative;
282283
height: calc(100% - 2rem);
283284
width: calc(100vw - 2rem);
@@ -357,7 +358,7 @@ It appears when the user clicks on the `Search` component or presses the corresp
357358
}
358359
359360
.results-container {
360-
background: var(--sk-back-2);
361+
background: var(--background);
361362
border-radius: 0 0 var(--sk-border-radius) var(--sk-border-radius);
362363
pointer-events: all;
363364
}
@@ -368,7 +369,7 @@ It appears when the user clicks on the `Search` component or presses the corresp
368369
font-size: 1.2rem;
369370
font-weight: normal;
370371
text-transform: uppercase;
371-
background-color: var(--sk-back-2);
372+
background-color: var(--background);
372373
pointer-events: all;
373374
}
374375

packages/site-kit/src/lib/search/SearchResultList.svelte

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@
6767
ul {
6868
position: relative;
6969
margin: 0;
70+
list-style: none;
7071
}
7172
7273
details {
@@ -76,14 +77,19 @@
7677
position: sticky;
7778
top: 0;
7879
display: block;
79-
background: var(--sk-back-2);
80+
background: var(--background);
8081
color: var(--sk-text-4);
8182
text-transform: uppercase;
8283
padding: 0.5rem var(--padding);
8384
font-size: var(--sk-text-xs);
8485
z-index: 2;
8586
user-select: none;
8687
88+
&:focus-visible {
89+
border-radius: var(--sk-border-radius);
90+
outline-offset: -3px;
91+
}
92+
8793
&::after {
8894
content: '';
8995
position: absolute;
@@ -108,7 +114,6 @@
108114
}
109115
110116
a {
111-
--background: var(--sk-back-2);
112117
display: block;
113118
text-decoration: none;
114119
line-height: 1;
@@ -143,6 +148,7 @@
143148
144149
&:hover {
145150
--background: var(--sk-back-4);
151+
text-decoration: none;
146152
}
147153
148154
&:focus {

0 commit comments

Comments
 (0)