---import { CATEGORIES } from'../lib/taxonomy';
import { url } from'../lib/url';
interface Props { active?:string }
const { active } = Astro.props;
---<!-- A chip per shelf over a 1px ink ground, so the row reads as one ruled
strip rather than as a scatter of floating pills — the same construction as the domain grid on the home page. Styling lives inglobal.css
(`.cat-nav`/`.cat-chip`) because the sheet pages use it too. --><navclass="cat-nav"aria-label="Categories">
<!-- The way out of a single shelf:every sheet in one filterable index. --> <ahref={url('sheets')}
class="cat-chip corners"style="--acc: var(--fg);"aria-current={active ==='all'?'page':undefined}
>
<spanclass="cat-chip__tag">ALL</span>All sheets
</a>
{CATEGORIES.map((c) => (
<ahref={url(c.slug)}
class="cat-chip corners"style={`--acc: var(--${c.accent});`}
aria-current={active === c.slug ?'page':undefined}
>
<spanclass="cat-chip__tag">{c.tag}</span>{c.title}
</a>
))}
</nav>
<style>
/* ---- Cyberdeck chrome for the chips ------------------------------------ Each chip carries `.corners`, but twelve always-on bracket sets read as clutter (the same call the record rows made), so the ticks stay clipped until the chip is under the pointer — or always on for the current page, where the bracket is the active marker's frame. Each chip's brackets take its own domain accent via `--bracket`. */ .cat-chip {
--bracket:var(--acc);
font-family:var(--font-term);
}
.cat-chip::before,
.cat-chip::after {
opacity:0;
transition:opacity180ms ease;
}
.cat-chip:hover::before,
.cat-chip:hover::after,
.cat-chip[aria-current='page']::before,
.cat-chip[aria-current='page']::after {
opacity:1;
}
/* The active chip is filled with its accent, so its own accent would vanish as a bracket colour — the frame flips to the page ground. */ .cat-chip[aria-current='page'] { --bracket:var(--base); }
/* Hover sharpens the tag's hairline underlay: the tag keeps its accent and picks up the stronger rule weight the rest of the site uses for active edges. */ .cat-chip:hover .cat-chip__tag { text-decoration:underline; text-underline-offset:3px; }
</style>