diff --git a/docs/visual-design.md b/docs/visual-design.md index 3522acc..1aebbc6 100644 --- a/docs/visual-design.md +++ b/docs/visual-design.md @@ -348,6 +348,14 @@ children starts expanded. A Topic with more than one parent therefore appears in more than one real branch; each occurrence is the same canonical Topic link, not a copy or alias, and each occurrence's disclosure operates independently. +The explorer uses the **Quiet hierarchy** treatment: one navigation font family, +slightly smaller Topic labels, stronger root labels and expanded branches, shallow +indentation, and subtle guide lines. Every current occurrence has a quiet tinted +row, a narrow accent rule, and stronger text. Keep long titles fully visible and +allow wrapping; give the desktop sidebar modest additional width rather than +shrinking deeper levels. Topic icons are omitted from this explorer so that labels +retain the available width. Disclosure controls and title links remain independent. + The forest is a navigation landmark labelled **Browse surrounding topics** and should read as nested navigation rather than a diagram. Use indentation, subtle guide rules, disclosure controls, and native linked titles. Do not use a graph @@ -432,7 +440,7 @@ visually secondary to main content and must not resemble the primary landing domain grid or imply that following the hierarchy is necessary to find a Topic. -Every Topic should display an icon when represented in navigation. Icons may +Every Topic should display an icon in these child-navigation rows. Icons may be reused, and the UI must provide a generic fallback when a specific icon is not available. A Topic optionally selects a supported icon through `iconKey`; the generated runtime value is `null` when no specific key is authored. diff --git a/src/app/topic/topic-hierarchy.css b/src/app/topic/topic-hierarchy.css index 073b2a7..610e624 100644 --- a/src/app/topic/topic-hierarchy.css +++ b/src/app/topic/topic-hierarchy.css @@ -17,6 +17,10 @@ h2 { display: none; } +.topic-hierarchy { + font-size: 0.9375rem; +} + .topic-hierarchy, .topic-hierarchy ul { min-width: 0; @@ -31,11 +35,28 @@ h2 { } .topic-hierarchy__item { - align-items: center; + align-items: start; + border-radius: var(--radius-small); display: grid; - gap: var(--space-1); - grid-template-columns: 1.75rem minmax(0, 1fr); - min-height: 2.25rem; + gap: 0.125rem; + grid-template-columns: 1.5rem minmax(0, 1fr); + min-height: 2.125rem; + position: relative; +} + +.topic-hierarchy__item--current { + background: color-mix(in srgb, var(--color-accent-forest-soft), var(--color-canvas) 55%); +} + +.topic-hierarchy__item--current::before { + background: var(--color-accent-forest); + border-radius: 2px; + bottom: 0.4375rem; + content: ''; + inset-inline-start: 0; + position: absolute; + top: 0.4375rem; + width: 3px; } .topic-hierarchy__disclosure { @@ -46,10 +67,10 @@ h2 { color: var(--color-muted); cursor: pointer; display: inline-flex; - height: 1.75rem; + height: 2.125rem; justify-content: center; padding: 0; - width: 1.75rem; + width: 1.5rem; } .topic-hierarchy__disclosure:hover { @@ -71,16 +92,16 @@ h2 { } .topic-hierarchy__spacer { - width: 1.75rem; + width: 1.5rem; } .topic-hierarchy__link { border-radius: var(--radius-small); color: var(--color-secondary); - line-height: 1.35; + line-height: 1.4; min-width: 0; overflow-wrap: anywhere; - padding: 0.3rem var(--space-1); + padding: 0.375rem var(--space-1); text-decoration-color: transparent; text-underline-offset: 0.18em; } @@ -90,6 +111,16 @@ h2 { text-decoration-color: currentColor; } +.topic-hierarchy__link--branch { + color: var(--color-text); + font-weight: 500; +} + +.topic-hierarchy__link--root { + color: var(--color-text); + font-weight: 600; +} + .topic-hierarchy__link--current { color: var(--color-text); font-weight: 650; @@ -98,8 +129,8 @@ h2 { .topic-hierarchy__children { border-inline-start: 1px solid var(--color-hairline); - margin-inline-start: 0.85rem; - padding-inline-start: 0.65rem; + margin-inline-start: 0.625rem; + padding-inline-start: 0.5rem; } @media (width <= 48rem) { @@ -142,6 +173,22 @@ h2 { } } +@media (pointer: coarse) { + .topic-hierarchy__item { + grid-template-columns: 2.75rem minmax(0, 1fr); + min-height: 2.75rem; + } + + .topic-hierarchy__disclosure { + height: 2.75rem; + width: 2.75rem; + } + + .topic-hierarchy__link { + min-height: 2.75rem; + } +} + @media (prefers-reduced-motion: reduce) { .topic-hierarchy__disclosure span { transition: none; diff --git a/src/app/topic/topic-hierarchy.html b/src/app/topic/topic-hierarchy.html index aba5331..4d6a30c 100644 --- a/src/app/topic/topic-hierarchy.html +++ b/src/app/topic/topic-hierarchy.html @@ -43,7 +43,10 @@