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