Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/pages/index.astro
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ const base = import.meta.env.BASE_URL;
<label class="search-field">
<svg class="search-icon" viewBox="0 0 24 24" aria-hidden="true"><circle cx="11" cy="11" r="7" fill="none" stroke="currentColor" stroke-width="2"/><path d="m20 20-4-4" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"/></svg>
<span class="sr-only">Search the documentation and the samples</span>
<input id="search-input" type="search" placeholder="Search docs and samples" autocomplete="off" spellcheck="false" role="combobox" aria-expanded="false" aria-controls="search-results" aria-autocomplete="list">
<input id="search-input" type="search" placeholder="Search" autocomplete="off" spellcheck="false" role="combobox" aria-expanded="false" aria-controls="search-results" aria-autocomplete="list">
<kbd class="search-key" aria-hidden="true">Ctrl K</kbd>
</label>
<div class="search-results" id="search-results" role="listbox" aria-label="Results" hidden></div>
Expand Down
33 changes: 18 additions & 15 deletions src/styles/global.css
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
--line: #e2e6ec;
--bg: #ffffff;
--card: #ffffff;
--soft: #f5f6f8;
--shadow: 0 1px 2px rgba(15, 23, 42, .06), 0 8px 24px rgba(15, 23, 42, .06);
--width: 1100px;
--font: Inter, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
Expand All @@ -37,6 +38,7 @@
--line: #273042;
--bg: #0f1522;
--card: #172033;
--soft: #161e2e;
--shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .25);
}
}
Expand Down Expand Up @@ -77,7 +79,7 @@ img { max-width: 100%; height: auto; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.hello { display: flex; align-items: center; gap: 24px; margin: 28px 0 40px; }
.hello-text { flex: 1 1 auto; min-width: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; }
.hello-text { flex: 1 1 auto; min-width: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; }
.welcome {
margin: 0; color: var(--ink);
font-size: clamp(28px, 4vw, 40px); font-weight: 700; letter-spacing: -.025em; line-height: 1.15;
Expand All @@ -90,30 +92,31 @@ img { max-width: 100%; height: auto; }
.hello-text { display: contents; }
.welcome { grid-area: 1 / 1; }
.hello-logo { grid-area: 1 / 2; width: 64px; height: 64px; align-self: center; }
.search { grid-area: 2 / 1 / 3 / 3; max-width: none; }
.search { grid-area: 2 / 1 / 3 / 3; }
.search-key { display: none; }
}

/* the box: as wide as a tile and a half, a soft field with the magnifier,
* the word and the shortcut - the look of the search in the docs' bar */
.search { position: relative; max-width: 480px; }
/* the box: a quiet pill under the greeting - a soft fill, no border, muted
* type; it only shows its edge when the reader is in it */
.search { position: relative; max-width: 190px; }
.search-field {
display: flex; align-items: center; gap: 10px; height: 44px; padding: 0 10px 0 14px;
border: 1px solid var(--line); border-radius: 12px; background: var(--card); cursor: text;
transition: border-color .15s, box-shadow .15s;
display: flex; align-items: center; gap: 7px; height: 32px; padding: 0 8px 0 11px;
border: 1px solid transparent; border-radius: 16px; background: var(--soft); cursor: text;
transition: border-color .15s, background-color .15s;
}
.search-field:hover { border-color: var(--muted); }
.search-field:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.search-icon { width: 18px; height: 18px; flex: none; color: var(--muted); }
.search-field:hover { border-color: var(--line); }
.search-field:focus-within { border-color: var(--brand); background: var(--card); }
.search-icon { width: 14px; height: 14px; flex: none; color: var(--muted); opacity: .7; }
.search-field input {
flex: 1 1 auto; min-width: 0; height: 100%; padding: 0; border: 0; outline: none; background: none;
color: var(--ink); font: inherit; font-size: 15px;
color: var(--ink); font: inherit; font-size: 13.5px;
}
.search-field input::placeholder { color: var(--muted); }
.search-field input::placeholder { color: var(--muted); opacity: .8; }
.search-field input::-webkit-search-cancel-button { display: none; }
/* the shortcut in a small key cap, as in the docs' bar */
.search-key {
flex: none; padding: 1px 7px; border: 1px solid var(--line); border-radius: 6px;
font: 500 12px/1.6 var(--font); color: var(--muted); white-space: nowrap;
flex: none; padding: 1px 5px; border: 1px solid var(--line); border-radius: 5px;
font: 500 10.5px/1.5 var(--font); color: var(--muted); white-space: nowrap;
}
.search-field:focus-within .search-key { visibility: hidden; }
@media (hover: none) { .search-key { display: none; } }
Expand Down
Loading