Skip to content

Commit f6c6cc5

Browse files
committed
make esc button more prominent/separate
1 parent 6298f93 commit f6c6cc5

File tree

1 file changed

+27
-19
lines changed

1 file changed

+27
-19
lines changed

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

Lines changed: 27 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ It appears when the user clicks on the `Search` component or presses the corresp
159159
use:trap
160160
>
161161
<div class="search-box">
162-
<div style="background: var(--background); padding: 0.5rem">
162+
<div class="controls">
163163
<input
164164
use:forcefocus
165165
onkeydown={(e) => {
@@ -177,12 +177,12 @@ It appears when the user clicks on the `Search` component or presses the corresp
177177
aria-label={placeholder}
178178
spellcheck="false"
179179
/>
180-
</div>
181180

182-
<button aria-label="Close" onclick={close}>
183-
<!-- <Icon name="close" /> -->
184-
<kbd>Esc</kbd>
185-
</button>
181+
<button class="raised" aria-label="Close" onclick={close}>
182+
<!-- <Icon name="close" /> -->
183+
<kbd>Esc</kbd>
184+
</button>
185+
</div>
186186

187187
<span id="search-description" class="visually-hidden">
188188
{#if search_description}
@@ -302,16 +302,22 @@ It appears when the user clicks on the `Search` component or presses the corresp
302302
}
303303
}
304304
305+
.controls {
306+
background: var(--background);
307+
padding: 0.5rem;
308+
display: flex;
309+
gap: 1rem;
310+
}
311+
305312
input {
306313
font: var(--sk-font-ui-large);
307-
width: 100%;
308-
padding: calc(var(--padding) - 0.5rem) 5rem calc(var(--padding) - 0.5rem) var(--padding);
314+
flex: 1;
315+
padding: var(--padding) calc(var(--padding) - 0.5rem);
309316
height: 6rem;
310317
border: none;
311-
border-bottom: 1px solid var(--sk-back-3);
312318
flex-shrink: 0;
313-
background: var(--sk-back-3);
314319
color: var(--sk-text-1);
320+
border-bottom: 1px solid var(--sk-back-6);
315321
316322
&::selection {
317323
background-color: var(--sk-back-translucent);
@@ -323,29 +329,31 @@ It appears when the user clicks on the `Search` component or presses the corresp
323329
}
324330
325331
&:focus-visible {
326-
outline-offset: -3px;
332+
outline-offset: -2px;
327333
}
328334
}
329335
330336
button[aria-label='Close'] {
331-
--size: 2rem;
332-
position: absolute;
333-
top: 0.5rem;
334-
right: 0;
335-
width: 5rem;
336-
height: 6rem;
337+
height: 100%;
338+
aspect-ratio: 1;
337339
background: none;
338340
color: var(--sk-text-2);
339-
opacity: 0.3;
340341
341342
&:focus-visible {
342343
opacity: 1;
343344
outline-offset: -3px;
344345
}
345346
346347
kbd {
348+
display: flex;
349+
align-items: center;
350+
justify-content: center;
347351
text-transform: uppercase;
348-
font: var(--sk-font-ui-small);
352+
background: none;
353+
font: var(--sk-font-ui-medium);
354+
color: var(--sk-text-4);
355+
width: 100%;
356+
height: 100%;
349357
}
350358
}
351359

0 commit comments

Comments
 (0)