improve TOC style somewhat
Still needs considerable work
This commit is contained in:
parent
415c5f56ef
commit
44656699ef
19 changed files with 55 additions and 50 deletions
|
@ -3,19 +3,22 @@ import TableOfContents from "./toc";
|
|||
import type { ConfigHeading, TypeTOC } from "./types.d.ts";
|
||||
|
||||
export interface Props {
|
||||
title?: string;
|
||||
headings?: ConfigHeading[];
|
||||
types?: TypeTOC;
|
||||
mobile: boolean;
|
||||
}
|
||||
|
||||
const { headings, types, mobile } = Astro.props;
|
||||
const { title, headings, types, mobile } = Astro.props;
|
||||
---
|
||||
|
||||
<div id="toc" aria-mobile={mobile} class=`toc-wrapper${mobile ? "-mobile":""}`>
|
||||
<TableOfContents
|
||||
config={headings}
|
||||
type={types}
|
||||
mobile={mobile}
|
||||
client:idle
|
||||
/>
|
||||
</div>
|
||||
{(headings?.length ?? 0) + (types?.length ?? 0) != 0 &&
|
||||
<div id="toc" aria-mobile={mobile} class=`toc-wrapper${mobile ? "-mobile":""}`>
|
||||
<TableOfContents
|
||||
title={title}
|
||||
config={headings}
|
||||
type={types}
|
||||
mobile={mobile}
|
||||
client:idle
|
||||
/>
|
||||
</div>
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue