Skip to content

Commit 291a5b3

Browse files
dzonatanalxhub
authored andcommitted
docs: visualize keyboard shortcut for search (#47507)
PR Close #47507
1 parent 478db89 commit 291a5b3

File tree

3 files changed

+24
-0
lines changed

3 files changed

+24
-0
lines changed

aio/src/app/search/search-box/search-box.component.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ import { debounceTime, distinctUntilChanged } from 'rxjs/operators';
2424
(keyup)="doSearch()"
2525
(focus)="doFocus()"
2626
(click)="doSearch()">
27+
<div class="search-box-shortcut">/</div>
2728
<mat-icon
2829
*ngIf="searchBox.value"
2930
(click)="searchBox.value = ''; searchBox.focus()">

aio/src/styles/1-layouts/top-menu/_top-menu-theme.scss

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,11 @@
8888
color: constants.$mediumgray;
8989
}
9090
}
91+
92+
.search-box-shortcut {
93+
border-color: constants.$mediumgray;
94+
color: constants.$mediumgray;
95+
}
9196
}
9297

9398
aio-theme-toggle {

aio/src/styles/1-layouts/top-menu/_top-menu.scss

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,24 @@ mat-toolbar.app-toolbar {
208208
}
209209
}
210210

211+
.search-box-shortcut {
212+
display: none;
213+
position: absolute;
214+
right: 16px;
215+
font-size: 1.2rem;
216+
line-height: 2.2rem;
217+
padding: 0 0.8rem;
218+
pointer-events: none;
219+
font-weight: bold;
220+
text-align: center;
221+
border-radius: 4px;
222+
border: 1px solid;
223+
}
224+
225+
input:not(:focus):placeholder-shown + .search-box-shortcut {
226+
display: block;
227+
}
228+
211229
mat-icon {
212230
position: absolute;
213231
color: constants.$blue;

0 commit comments

Comments
 (0)