feat(blog): render search input, empty-state, hidden utility
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
5ac622e576
commit
d7dc22d0c8
2 changed files with 98 additions and 1 deletions
|
|
@ -1,3 +1,82 @@
|
|||
---
|
||||
// Stub — real implementation lands in Task 4.
|
||||
// Light client-side filter for the blog archive.
|
||||
// Reads [data-search] attributes on rows + the featured article, hides
|
||||
// non-matches, collapses empty year heads, toggles a no-results message.
|
||||
// Filter script is added in Task 5; this file ships markup + styles only.
|
||||
---
|
||||
|
||||
<div class="bsearch">
|
||||
<input
|
||||
type="search"
|
||||
class="bsearch__input"
|
||||
aria-label="Search posts"
|
||||
placeholder="Search the journal…"
|
||||
autocomplete="off"
|
||||
spellcheck="false"
|
||||
/>
|
||||
<span class="bsearch__hint" aria-hidden="true">Esc to clear</span>
|
||||
</div>
|
||||
|
||||
<style>
|
||||
.bsearch {
|
||||
display: flex;
|
||||
align-items: baseline;
|
||||
gap: 14px;
|
||||
padding: clamp(14px, 2.4vh, 22px) 0;
|
||||
border-top: 1px solid var(--hairline-on-dark);
|
||||
border-bottom: 1px solid var(--hairline-on-dark);
|
||||
}
|
||||
:global(body:not(.dark)) .bsearch {
|
||||
border-top-color: var(--hairline);
|
||||
border-bottom-color: var(--hairline);
|
||||
}
|
||||
.bsearch__input {
|
||||
flex: 1;
|
||||
max-width: 28ch;
|
||||
background: transparent;
|
||||
border: 0;
|
||||
border-bottom: 1px solid transparent;
|
||||
padding: 6px 0;
|
||||
font-family: var(--font-mono);
|
||||
font-size: 13px;
|
||||
color: var(--fg-on-dark-1);
|
||||
letter-spacing: 0.02em;
|
||||
outline: none;
|
||||
transition: border-color var(--dur-base) var(--ease-out);
|
||||
}
|
||||
:global(body:not(.dark)) .bsearch__input {
|
||||
color: var(--fg-1);
|
||||
}
|
||||
.bsearch__input::placeholder {
|
||||
color: var(--fg-on-dark-3);
|
||||
}
|
||||
:global(body:not(.dark)) .bsearch__input::placeholder {
|
||||
color: var(--fg-3);
|
||||
}
|
||||
.bsearch__input:focus {
|
||||
border-bottom-color: var(--accent);
|
||||
}
|
||||
.bsearch__hint {
|
||||
font-family: var(--font-mono);
|
||||
font-size: 11px;
|
||||
color: var(--fg-on-dark-3);
|
||||
letter-spacing: 0.06em;
|
||||
opacity: 0;
|
||||
transition: opacity var(--dur-base) var(--ease-out);
|
||||
}
|
||||
:global(body:not(.dark)) .bsearch__hint {
|
||||
color: var(--fg-3);
|
||||
}
|
||||
.bsearch:focus-within .bsearch__hint {
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
@media (max-width: 800px) {
|
||||
.bsearch__input {
|
||||
max-width: none;
|
||||
}
|
||||
.bsearch__hint {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue