@@ -160,23 +160,29 @@ It appears when the user clicks on the `Search` component or presses the corresp
160
160
>
161
161
<div class =" search-box" >
162
162
<div class =" controls" >
163
- <input
164
- use:forcefocus
165
- onkeydown ={(e ) => {
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 >
180
186
181
187
<button class ="raised" aria-label ="Close" onclick ={close }>
182
188
<!-- <Icon name="close" /> -->
@@ -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 }
@@ -309,39 +316,65 @@ It appears when the user clicks on the `Search` component or presses the corresp
309
316
gap : 1rem ;
310
317
}
311
318
312
- input {
313
- font : var ( --sk-font-ui-large ) ;
319
+ . input-group {
320
+ position : relative ;
314
321
flex : 1 ;
315
- padding : var (--padding ) calc (var (--padding ) - 0.5rem );
316
- height : 6rem ;
317
- border : none ;
318
- flex-shrink : 0 ;
319
- color : var (--sk-text-1 );
320
- border-bottom : 1px solid var (--sk-back-6 );
321
-
322
- &::selection {
323
- background-color: var (--sk-back-translucent );
324
- }
325
322
326
- &::placeholder {
327
- color : var (--sk-text-2 );
328
- opacity : 0.3 ;
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
+
333
+ &::selection {
334
+ background-color: var (--sk-back-translucent );
335
+ }
336
+
337
+ &::placeholder {
338
+ color : var (--sk-text-2 );
339
+ opacity : 0.3 ;
340
+ }
341
+
342
+ &:focus-visible {
343
+ outline-offset : -2px ;
344
+ }
329
345
}
330
346
331
- &:focus-visible {
332
- outline-offset : -2px ;
347
+ button {
348
+ position : absolute ;
349
+ right : 0 ;
350
+ top : 0 ;
351
+ height : 100% ;
352
+ aspect-ratio : 1 ;
353
+ color : var (--sk-text-4 );
354
+
355
+ &:hover,
356
+ &:focus {
357
+ color : var (--sk-text-3 );
358
+ }
359
+
360
+ &:focus-visible {
361
+ outline-offset : -2px ;
362
+ }
333
363
}
334
364
}
335
365
336
366
button [aria-label = ' Close' ] {
337
367
height : 100% ;
338
368
aspect-ratio : 1 ;
339
369
background : none ;
340
- color : var (--sk-text-2 );
370
+
371
+ &:hover,
372
+ &:focus {
373
+ color : var (--sk-text-3 );
374
+ }
341
375
342
376
&:focus-visible {
343
- opacity: 1 ;
344
- outline-offset : -3px ;
377
+ outline-offset : -2px ;
345
378
}
346
379
347
380
kbd {
@@ -371,14 +404,22 @@ It appears when the user clicks on the `Search` component or presses the corresp
371
404
pointer-events : all ;
372
405
background : var (--background );
373
406
407
+ ul {
408
+ padding : 0 var (--padding );
409
+ }
410
+
374
411
li {
375
412
position : relative ;
413
+ display : flex ;
414
+ gap : 1rem ;
376
415
377
416
a {
378
417
color : var (--sk-text-2 );
379
418
display : block ;
380
419
text-decoration : none ;
381
- padding : 0.5rem calc (4rem + var (--padding )) 0.5rem var (--padding );
420
+ margin : 0 -0.5rem ;
421
+ padding : 0.5rem ;
422
+ flex : 1 ;
382
423
383
424
&:hover {
384
425
background : rgba (0 , 0 , 0 , 0.05 );
@@ -390,21 +431,17 @@ It appears when the user clicks on the `Search` component or presses the corresp
390
431
}
391
432
392
433
button [aria-label = ' Delete' ] {
393
- position : absolute ;
394
- top : 0 ;
395
- right : 0 ;
396
- width : 5rem ;
397
- height : 100% ;
398
- color : var (--sk-text-2 );
399
- opacity : 0.1 ;
434
+ width : 3.2rem ;
435
+ height : 3.2rem ;
436
+ color : var (--sk-text-4 );
400
437
401
438
&:hover {
402
- opacity: 1 ;
403
439
outline: none ;
440
+ color : var (--sk-text-3 );
404
441
}
405
442
406
443
&:focus-visible {
407
- opacity : 1 ;
444
+ color : var ( --sk-text-3 ) ;
408
445
outline-offset : -3px ;
409
446
}
410
447
}
0 commit comments