parent
66968582ef
commit
357de9eb39
1 changed files with 28 additions and 15 deletions
|
@ -1,12 +1,14 @@
|
||||||
.book-page {
|
$startLevel: 1;
|
||||||
.markdown {
|
$endLevel: 6;
|
||||||
@for $h from 1 through 6 {
|
|
||||||
> h#{$h} {
|
.book-page .markdown {
|
||||||
counter-increment: h#{$h};
|
@for $currentLevel from $startLevel through $endLevel {
|
||||||
counter-reset: h#{$h + 1};
|
> h#{$currentLevel} {
|
||||||
|
counter-increment: h#{$currentLevel};
|
||||||
|
counter-reset: h#{$currentLevel + 1};
|
||||||
|
|
||||||
$content: "";
|
$content: "";
|
||||||
@for $n from 1 through $h {
|
@for $n from $startLevel through $currentLevel {
|
||||||
$content: $content + 'counter(h#{$n})"."';
|
$content: $content + 'counter(h#{$n})"."';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -15,9 +17,20 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.book-toc nav ul {
|
||||||
|
li {
|
||||||
|
counter-increment: item;
|
||||||
|
|
||||||
|
&:first-child {
|
||||||
|
counter-reset: item;
|
||||||
}
|
}
|
||||||
|
|
||||||
+ .book-toc nav ul {
|
&:before {
|
||||||
list-style: decimal;
|
content: counters(item, ".") ". ";
|
||||||
|
float: left;
|
||||||
|
margin-right: $padding-4;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue