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
10 changes: 9 additions & 1 deletion docs/visual-design.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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.
Expand Down
69 changes: 58 additions & 11 deletions src/app/topic/topic-hierarchy.css
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ h2 {
display: none;
}

.topic-hierarchy {
font-size: 0.9375rem;
}

.topic-hierarchy,
.topic-hierarchy ul {
min-width: 0;
Expand All @@ -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 {
Expand All @@ -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 {
Expand All @@ -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;
}
Expand All @@ -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;
Expand All @@ -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) {
Expand Down Expand Up @@ -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;
Expand Down
7 changes: 6 additions & 1 deletion src/app/topic/topic-hierarchy.html
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,10 @@ <h2>Browse surrounding topics</h2>
@let expanded = isExpanded(nodePath);

<li>
<div class="topic-hierarchy__item">
<div
class="topic-hierarchy__item"
[class.topic-hierarchy__item--current]="node.id === currentTopicId()"
>
@if (hasChildren) {
<button
class="topic-hierarchy__disclosure"
Expand All @@ -61,6 +64,8 @@ <h2>Browse surrounding topics</h2>

<a
class="topic-hierarchy__link"
[class.topic-hierarchy__link--root]="parentPath === ''"
[class.topic-hierarchy__link--branch]="hasChildren && expanded"
[class.topic-hierarchy__link--current]="node.id === currentTopicId()"
[attr.aria-current]="node.id === currentTopicId() ? 'page' : null"
[routerLink]="['/topics', node.id]"
Expand Down
6 changes: 3 additions & 3 deletions src/app/topic/topic-page.css
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ h1 {
align-items: start;
display: grid;
gap: clamp(2rem, 4vw, 3.5rem);
grid-template-columns: minmax(13rem, 16rem) minmax(0, 1fr);
grid-template-columns: minmax(14rem, 18rem) minmax(0, 1fr);
position: relative;
}

Expand Down Expand Up @@ -75,8 +75,8 @@ app-topic-outline {

@media (width >= 82rem) {
.topic-page__layout--with-outline {
gap: clamp(1.5rem, 3vw, 3rem);
grid-template-columns: minmax(13rem, 15rem) minmax(0, 1fr) minmax(10rem, 12rem);
gap: clamp(1.5rem, 2vw, 2rem);
grid-template-columns: minmax(14rem, 18rem) minmax(0, 1fr) minmax(10rem, 12rem);
}

app-topic-outline {
Expand Down
Loading