Skip to content

Commit

Permalink
feat: support name only TOC node
Browse files Browse the repository at this point in the history
  • Loading branch information
yufeih committed Apr 10, 2023
1 parent a002cb6 commit a932450
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
6 changes: 6 additions & 0 deletions templates/modern/src/toc.scss
Original file line number Diff line number Diff line change
Expand Up @@ -60,4 +60,10 @@ $expand-stub-width: .85rem;
li.expanded > .expand-stub::before {
transform: rotate(90deg);
}

span.name-only {
font-weight: 600;
display: inline-block;
margin: .4rem 0;
}
}
2 changes: 1 addition & 1 deletion templates/modern/src/toc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ export async function renderToc(): Promise<TocNode[]> {
const dom = href
? html`<a class='${classMap({ 'nav-link': !activeNodes.includes(node) })}' href=${href}>${breakWordLit(name)}</a>`
: (isLeaf
? html`<span class='name'>${breakWordLit(name)}</a>`
? html`<span class='text-body-tertiary name-only'>${breakWordLit(name)}</a>`
: html`<a class='${classMap({ 'nav-link': !activeNodes.includes(node) })}' href='#' @click=${toggleExpand}>${breakWordLit(name)}</a>`)
return html`
Expand Down

0 comments on commit a932450

Please sign in to comment.