Skip to content

Commit 51f0f48

Browse files
committed
style search strategy checkbox
1 parent 045553b commit 51f0f48

2 files changed

Lines changed: 45 additions & 4 deletions

File tree

css/search.css

Lines changed: 41 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,27 @@
2323
}
2424
}
2525

26-
input {
26+
label:has(input[type="checkbox"]) {
27+
margin-inline-end: auto;
28+
display: flex;
29+
align-items: center;
30+
gap: var(--size-2);
31+
font-size: var(--font-size-0);
32+
33+
input {
34+
color: white;
35+
}
36+
}
37+
38+
input[type="search"]:invalid + input[name="checkbox"] {
39+
right: 20px;
40+
}
41+
42+
input[type="search"]:valid + input[name="checkbox"] {
43+
right: 50px;
44+
}
45+
46+
input[type="search"] {
2747
display: block;
2848
margin: 0 var(--size-2) var(--size-2);
2949

@@ -64,13 +84,33 @@
6484
overflow: auto;
6585

6686
article {
87+
max-height: 35vh;
88+
overflow: hidden;
89+
90+
scroll-margin-top: var(--size-2);
91+
/* overscroll-behavior: ; */
92+
6793
font-weight: var(--font-weight-2);
6894

6995
border: 1px solid var(--gray-2);
7096
border-radius: var(--radius-2);
7197
background: white;
7298
box-shadow: var(--shadow-2);
7399

100+
transition:
101+
max-height 300ms ease,
102+
box-shadow 250ms ease;
103+
104+
&:hover {
105+
box-shadow: var(--shadow-3);
106+
}
107+
108+
&:is(:focus, :focus-visible, :focus-within) {
109+
overflow: auto;
110+
outline-offset: 5px;
111+
outline: 1px auto;
112+
}
113+
74114
@media (prefers-color-scheme: dark) {
75115
border-color: var(--gray-7);
76116
background: var(--gray-8);

index.html

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -94,10 +94,11 @@ <h2>Indexes</h2>
9494
<main>
9595
<search-form input="#query" on="input focus">
9696
<section>
97-
<input id="query" name="query" type="search" autocomplete="off" placeholder="search" />
97+
<input id="query" name="query" type="search" autocomplete="off" placeholder="search" required />
9898
<result-stats>
99-
<search-time id="processing-time"></search-time>
100-
<total-hits></total-hits>
99+
<label for="strategy"><input type="checkbox" id="strategy" name="strategy" value="all" title="Search Strategy: All" /> Search Strategy: All</label>
100+
<search-time id="processing-time">0ms</search-time>
101+
<total-hits>0 Hits</total-hits>
101102
</result-stats>
102103
</section>
103104
<search-results>Loading...</search-results>

0 commit comments

Comments
 (0)