feat(ui): harmoniser navigation pages d’entrée et recherche
All checks were successful
SMOKE / smoke (push) Successful in 6s
CI / build-and-anchors (push) Successful in 44s
CI / build-and-anchors (pull_request) Successful in 36s

This commit is contained in:
2026-04-25 01:31:14 +02:00
parent 8605b7198f
commit 64e56e8abc
10 changed files with 835 additions and 254 deletions

View File

@@ -28,6 +28,7 @@ const tocId = `toc-global-${collection}-${String(basePath).replace(/[^\w-]+/g, "
<nav
class="toc-global"
data-mobile-default="closed"
aria-label={label}
data-toc-global
data-toc-key={`global:${collection}:${basePath}`}
@@ -35,14 +36,14 @@ const tocId = `toc-global-${collection}-${String(basePath).replace(/[^\w-]+/g, "
<button
class="toc-global__head toc-global__toggle"
type="button"
aria-expanded="true"
aria-expanded="false"
aria-controls={tocId}
>
<span class="toc-global__title">{label}</span>
<span class="toc-global__chevron" aria-hidden="true">▾</span>
</button>
<div class="toc-global__body-clip" id={tocId}>
<div class="toc-global__body-clip" id={tocId} hidden>
<div class="toc-global__body">
<ol class="toc-global__list">
{entries.map((e) => {
@@ -291,6 +292,10 @@ const tocId = `toc-global-${collection}-${String(basePath).replace(/[^\w-]+/g, "
max-height: min(42vh, 360px);
padding-right: 4px;
}
.toc-global__body-clip[hidden]{
display: none !important;
}
}
@media (prefers-color-scheme: dark){
@@ -332,9 +337,16 @@ const tocId = `toc-global-${collection}-${String(basePath).replace(/[^\w-]+/g, "
const setOpen = (open, { persist = true } = {}) => {
const isMobile = mq.matches;
nav.classList.toggle("is-collapsed", isMobile && !open);
toggle.setAttribute("aria-expanded", open ? "true" : "false");
if (persist && isMobile) write(open);
const effectiveOpen = isMobile ? open : true;
nav.classList.toggle("is-collapsed", isMobile && !effectiveOpen);
toggle.setAttribute("aria-expanded", effectiveOpen ? "true" : "false");
if (bodyClip) {
bodyClip.hidden = isMobile && !effectiveOpen;
}
if (persist && isMobile) write(effectiveOpen);
};
const initState = () => {