Skip to content

Commit 8d545a8

Browse files
jay-esmilos018
andauthored
add <label> tag for API Reference page (#1560) (#302)
* add <label> tag for API Reference page * filter label and input are now responsive * refactor css + input type is search Co-authored-by: Milos Dimitrijevic <[email protected]>
1 parent a5bb271 commit 8d545a8

File tree

1 file changed

+26
-3
lines changed

1 file changed

+26
-3
lines changed

src/api/ApiIndex.vue

Lines changed: 26 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,13 +67,29 @@ function slugify(text: string): string {
6767
<div id="api-index">
6868
<div class="header">
6969
<h1>API Reference</h1>
70-
<input class="api-filter" placeholder="Filter" v-model="query" />
70+
<div class="api-filter">
71+
<label for="api-filter">Filter</label>
72+
<input
73+
type="search"
74+
placeholder="Enter keyword"
75+
id="api-filter"
76+
v-model="query"
77+
/>
78+
</div>
7179
</div>
7280

73-
<div v-for="section of filtered" :key="section.text" class="api-section">
81+
<div
82+
v-for="section of filtered"
83+
:key="section.text"
84+
class="api-section"
85+
>
7486
<h2 :id="slugify(section.text)">{{ section.text }}</h2>
7587
<div class="api-groups">
76-
<div v-for="item of section.items" :key="item.text" class="api-group">
88+
<div
89+
v-for="item of section.items"
90+
:key="item.text"
91+
class="api-group"
92+
>
7793
<h3>{{ item.text }}</h3>
7894
<ul>
7995
<li v-for="h of item.headers" :key="h">
@@ -167,6 +183,13 @@ h3 {
167183
}
168184
169185
.api-filter {
186+
display: flex;
187+
align-items: center;
188+
justify-content: flex-start;
189+
gap: 1rem;
190+
}
191+
192+
.api-filter input {
170193
border: 1px solid var(--vt-c-divider);
171194
border-radius: 8px;
172195
padding: 6px 12px;

0 commit comments

Comments
 (0)