Skip to content

Commit c74fa05

Browse files
authored
Merge pull request #172 from phel-lang/update-search-bar
Update search bar
2 parents 9e32774 + 4e049cb commit c74fa05

File tree

3 files changed

+37
-0
lines changed

3 files changed

+37
-0
lines changed

css/components/header.css

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -519,6 +519,10 @@ body.menu-open {
519519
-webkit-backdrop-filter: blur(var(--backdrop-blur-lg));
520520
}
521521

522+
.dark .mobile-menu-overlay.active {
523+
background: #151a24f6;
524+
}
525+
522526
.dark .mobile-menu__nav a {
523527
background: var(--color-dark-surface);
524528
border-color: var(--color-dark-border);

css/components/search.css

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,32 @@
4747
color: var(--color-gray-light);
4848
}
4949

50+
/* Keyboard shortcut indicator */
51+
.search-shortcut {
52+
position: absolute;
53+
right: 12px;
54+
top: 50%;
55+
transform: translateY(-50%);
56+
padding: 3px 8px;
57+
font-size: 0.8rem;
58+
font-weight: 600;
59+
color: var(--color-gray-light);
60+
background-color: var(--color-light-bg-secondary);
61+
border: 1px solid var(--color-light-border);
62+
border-radius: var(--radius-sm);
63+
pointer-events: none;
64+
transition: opacity var(--duration-fast) var(--ease-out);
65+
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
66+
line-height: 1;
67+
}
68+
69+
/* Hide shortcut when input has content or is focused */
70+
.site-header__search.has-content .search-shortcut,
71+
#search:focus + .search-shortcut {
72+
opacity: 0;
73+
pointer-events: none;
74+
}
75+
5076
/* Custom clear button for search input */
5177
#search::-webkit-search-cancel-button {
5278
-webkit-appearance: none;
@@ -390,6 +416,12 @@
390416
color: var(--color-dark-text-muted);
391417
}
392418

419+
.dark .search-shortcut {
420+
color: var(--color-dark-text-muted);
421+
background-color: rgba(255, 255, 255, 0.05);
422+
border-color: #3a3a3a;
423+
}
424+
393425
.dark #search::-webkit-search-cancel-button {
394426
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%23999999' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'%3E%3C/circle%3E%3Cline x1='15' y1='9' x2='9' y2='15'%3E%3C/line%3E%3Cline x1='9' y1='9' x2='15' y2='15'%3E%3C/line%3E%3C/svg%3E");
395427
opacity: 0.8;

templates/header.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
<!-- Search (always visible, but styled differently on mobile) -->
2121
<div class="site-header__search">
2222
<input type="search" id="search" autocomplete="off" placeholder="Search the documentation and API…">
23+
<kbd class="search-shortcut" id="search-shortcut" aria-hidden="true">/</kbd>
2324
<div id="search-results" class="search-results">
2425
<ul id="search-results__items" class="search-results__items"></ul>
2526
</div>

0 commit comments

Comments
 (0)