Table of Contents

  1. First Section
  2. Second Section
    • Subsection 1
    • Subsection 2
  3. Third Section
scss/canvas/slide-pattern/_toc.scss

Usage

<!-- _class: toc -->

## Table of Contents

1. First Section
1. Second Section
   - Subsection 1
   - Subsection 2
1. Third Section
scss/canvas/slide-pattern/_toc.scss

Structure

  • h2: Table of contents heading
  • ol/ul: Table of contents items
    • Larger font, loose line height
    • Nested items at normal size
scss/canvas/slide-pattern/_toc.scss

CSS Variables

CSS Variable Default
--toc-list-font-size var(--font-size-xl) (52px)
--toc-list-line-height var(--line-height-loose) (2)
scss/canvas/slide-pattern/_toc.scss

Customized TOC

  1. Introduction
  2. Main Content
  3. Summary
scss/canvas/slide-pattern/_toc.scss

Customization Example

---
style: |
  section.toc {
    --toc-list-font-size: 1.5em;
    --toc-list-line-height: 1.8;
  }
---

Override list font size and line height.

scss/canvas/slide-pattern/_toc.scss