@@ -159,31 +159,37 @@ It appears when the user clicks on the `Search` component or presses the corresp
159
159
use:trap
160
160
>
161
161
<div class =" search-box" >
162
- <div style =" background: var(--background); padding: 0.5rem" >
163
- <input
164
- use:forcefocus
165
- onkeydown ={(e ) => {
162
+ <div class =" controls" >
163
+ <div class =" input-group" >
164
+ <input
165
+ use:forcefocus
166
+ onkeydown ={(e ) => {
166
167
if (e .key === ' Enter' && ! e .isComposing ) {
167
168
const element = modal .querySelector (' a[data-has-node]' ) as HTMLElement | undefined ;
168
169
element ?.click ();
169
170
}
170
171
}}
171
- oninput ={(e ) => {
172
- $search_query = e .currentTarget .value ;
173
- }}
174
- value ={$search_query }
175
- {placeholder }
176
- aria-describedby =" search-description"
177
- aria-label ={placeholder }
178
- spellcheck =" false"
179
- />
172
+ oninput ={(e ) => {
173
+ $search_query = e .currentTarget .value ;
174
+ }}
175
+ value ={$search_query }
176
+ {placeholder }
177
+ aria-describedby =" search-description"
178
+ aria-label ={placeholder }
179
+ spellcheck =" false"
180
+ />
181
+
182
+ <button aria-label ="Clear" onclick ={() => ($search_query = ' ' )}>
183
+ <Icon name =" close" />
184
+ </button >
185
+ </div >
186
+
187
+ <button class ="raised" aria-label ="Close" onclick ={close }>
188
+ <!-- <Icon name="close" /> -->
189
+ <kbd >Esc</kbd >
190
+ </button >
180
191
</div >
181
192
182
- <button aria-label ="Close" onclick ={close }>
183
- <!-- <Icon name="close" /> -->
184
- <kbd >Esc</kbd >
185
- </button >
186
-
187
193
<span id =" search-description" class =" visually-hidden" >
188
194
{#if search_description }
189
195
{@render search_description ()}
@@ -222,14 +228,15 @@ It appears when the user clicks on the `Search` component or presses the corresp
222
228
</a >
223
229
224
230
<button
231
+ class =" raised icon"
225
232
aria-label =" Delete"
226
233
onclick ={(e ) => {
227
234
$search_recent = $search_recent .filter ((href ) => href !== search .href );
228
235
e .stopPropagation ();
229
236
e .preventDefault ();
230
237
}}
231
238
>
232
- <Icon name =" delete" />
239
+ <Icon name ="delete" size ={ 16 } />
233
240
</button >
234
241
</li >
235
242
{/each }
@@ -302,50 +309,85 @@ It appears when the user clicks on the `Search` component or presses the corresp
302
309
}
303
310
}
304
311
305
- input {
306
- font : var (--sk-font-ui-large );
307
- width : 100% ;
308
- padding : calc (var (--padding ) - 0.5rem ) 5rem calc (var (--padding ) - 0.5rem ) var (--padding );
309
- height : 6rem ;
310
- border : none ;
311
- border-bottom : 1px solid var (--sk-back-3 );
312
- flex-shrink : 0 ;
313
- background : var (--sk-back-3 );
314
- color : var (--sk-text-1 );
315
-
316
- &::selection {
317
- background-color: var (--sk-back-translucent );
318
- }
312
+ .controls {
313
+ background : var (--background );
314
+ padding : 0.5rem ;
315
+ display : flex ;
316
+ gap : 1rem ;
317
+ }
319
318
320
- &::placeholder {
321
- color : var (--sk-text-2 );
322
- opacity : 0.3 ;
319
+ .input-group {
320
+ position : relative ;
321
+ flex : 1 ;
322
+
323
+ input {
324
+ font : var (--sk-font-ui-large );
325
+ width : 100% ;
326
+ padding : var (--padding ) 6rem var (--padding ) calc (var (--padding ) - 0.5rem );
327
+ height : 6rem ;
328
+ border : none ;
329
+ flex-shrink : 0 ;
330
+ color : var (--sk-text-1 );
331
+ border-bottom : 1px solid var (--sk-back-6 );
332
+ background : inherit ;
333
+
334
+ &::selection {
335
+ background-color: var (--sk-back-translucent );
336
+ }
337
+
338
+ &::placeholder {
339
+ color : var (--sk-text-2 );
340
+ opacity : 0.3 ;
341
+ }
342
+
343
+ &:focus-visible {
344
+ outline-offset : -2px ;
345
+ }
323
346
}
324
347
325
- &:focus-visible {
326
- outline-offset : -3px ;
348
+ button {
349
+ position : absolute ;
350
+ right : 0 ;
351
+ top : 0 ;
352
+ height : 100% ;
353
+ aspect-ratio : 1 ;
354
+ color : var (--sk-text-4 );
355
+
356
+ &:hover,
357
+ &:focus {
358
+ color : var (--sk-text-3 );
359
+ }
360
+
361
+ &:focus-visible {
362
+ outline-offset : -2px ;
363
+ }
327
364
}
328
365
}
329
366
330
367
button [aria-label = ' Close' ] {
331
- --size : 2rem ;
332
- position : absolute ;
333
- top : 0.5rem ;
334
- right : 0 ;
335
- width : 5rem ;
336
- height : 6rem ;
368
+ height : 100% ;
369
+ aspect-ratio : 1 ;
337
370
background : none ;
338
- color : var (--sk-text-2 );
339
- opacity : 0.3 ;
371
+
372
+ &:hover,
373
+ &:focus {
374
+ color : var (--sk-text-3 );
375
+ }
340
376
341
377
&:focus-visible {
342
- opacity: 1 ;
343
- outline-offset : -3px ;
378
+ outline-offset : -2px ;
344
379
}
345
380
346
381
kbd {
382
+ display : flex ;
383
+ align-items : center ;
384
+ justify-content : center ;
347
385
text-transform : uppercase ;
348
- font : var (--sk-font-ui-small );
386
+ background : none ;
387
+ font : var (--sk-font-ui-medium );
388
+ color : var (--sk-text-4 );
389
+ width : 100% ;
390
+ height : 100% ;
349
391
}
350
392
}
351
393
@@ -365,38 +407,40 @@ It appears when the user clicks on the `Search` component or presses the corresp
365
407
366
408
li {
367
409
position : relative ;
410
+ display : flex ;
411
+ padding : 0.2rem var (--padding );
412
+ gap : 1rem ;
413
+
414
+ &:hover {
415
+ background : var (--sk-back-3 );
416
+ }
368
417
369
418
a {
370
419
color : var (--sk-text-2 );
371
420
display : block ;
372
421
text-decoration : none ;
373
- padding : 0.5rem calc (4rem + var (--padding )) 0.5rem var (--padding );
374
-
375
- &:hover {
376
- background : rgba (0 , 0 , 0 , 0.05 );
377
- }
422
+ margin : 0 -0.5rem ;
423
+ padding : 0.5rem ;
424
+ flex : 1 ;
378
425
379
426
&:focus {
380
427
outline-offset: -3px ;
381
428
}
382
429
}
383
430
384
431
button [aria-label = ' Delete' ] {
385
- position : absolute ;
386
- top : 0 ;
387
- right : 0 ;
388
- width : 5rem ;
389
- height : 100% ;
390
- color : var (--sk-text-2 );
391
- opacity : 0.1 ;
432
+ width : 3.2rem ;
433
+ height : 3.2rem ;
434
+ color : var (--sk-text-4 );
435
+ background-color : var (--sk-back-2 );
392
436
393
437
&:hover {
394
- opacity: 1 ;
395
438
outline: none ;
439
+ color : var (--sk-text-3 );
396
440
}
397
441
398
442
&:focus-visible {
399
- opacity : 1 ;
443
+ color : var ( --sk-text-3 ) ;
400
444
outline-offset : -3px ;
401
445
}
402
446
}
0 commit comments