summaryrefslogtreecommitdiff
path: root/themes/hugo-book/assets/plugins/_numbered.scss
blob: 3b5570ea72c59f5b3c37328fe21336501c3ff79b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
$startLevel: 1;
$endLevel: 6;

.book-page .markdown.book-article {
  @for $currentLevel from $startLevel through $endLevel {
    h#{$currentLevel} {
      counter-increment: h#{$currentLevel};
      counter-reset: h#{$currentLevel + 1};

      $content: "";
      @for $n from $startLevel through $currentLevel {
        $content: $content + 'counter(h#{$n})"."';
      }

      &::before {
        content: unquote($content) " ";
      }
    }
  }
}

.book-toc nav#TableOfContents ul {
  counter-reset: item;

  li {
    counter-increment: item;

    > a:before {
      content: counters(item, ".") ". ";
    }
  }
}
Directive (EU) 2019/790, Article 4(3); all rights regarding Text and Data Mining (TDM) are reserved.