Skip to content

Commit cad62d3

Browse files
committed
h5 and h6 levels, plus some cleanup
1 parent 8ca6689 commit cad62d3

File tree

1 file changed

+70
-24
lines changed

1 file changed

+70
-24
lines changed

src/assets/sass/modules/_lists.scss

Lines changed: 70 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -301,36 +301,62 @@ dd {
301301
.list--toc {
302302
padding: 0;
303303
list-style: none;
304-
counter-reset: toc-counter;
304+
counter-reset: toc-h2-counter;
305+
306+
ul {
307+
list-style: none;
308+
}
305309

306310
> li {
307-
counter-increment: toc-counter;
311+
counter-increment: toc-h2-counter;
308312

309313
&::before {
310-
content: counter(toc-counter) "\00A0" "\00A0";
314+
content: counter(toc-h2-counter) "\00A0" "\00A0";
311315
}
312316

313317
> ul {
314-
list-style: none;
315-
counter-reset: toc-sub-counter;
318+
counter-reset: toc-h3-counter;
316319

317320
> li {
318-
counter-increment: toc-sub-counter;
321+
counter-increment: toc-h3-counter;
319322

320323
&::before {
321-
content: counter(toc-counter) "\002E" counter(toc-sub-counter) "\00A0" "\00A0";
324+
content: counter(toc-h2-counter) "\002E" counter(toc-h3-counter) "\00A0" "\00A0";
322325
}
323-
}
324326

325-
> ul {
326-
list-style: none;
327-
counter-reset: toc-sub-sub-counter;
327+
> ul {
328+
counter-reset: toc-h4-counter;
329+
330+
> li {
331+
counter-increment: toc-h4-counter;
332+
333+
&::before {
334+
content: counter(toc-h2-counter) "\002E" counter(toc-h3-counter) "\002E" counter(toc-h4-counter) "\00A0" "\00A0";
335+
}
336+
337+
> ul {
338+
counter-reset: toc-h5-counter;
339+
340+
> li {
341+
counter-increment: toc-h5-counter;
342+
343+
&::before {
344+
content: counter(toc-h2-counter) "\002E" counter(toc-h3-counter) "\002E" counter(toc-h4-counter) "\002E" counter(toc-h5-counter) "\00A0" "\00A0";
345+
}
346+
}
347+
348+
ul {
349+
counter-reset: toc-h6-counter;
328350

329-
> li {
330-
counter-increment: toc-sub-sub-counter;
351+
li {
352+
counter-increment: toc-h6-counter;
331353

332-
&::before {
333-
content: counter(toc-counter) "\002E" counter(toc-sub-counter) "\002E" counter(toc-sub-sub-counter) "\00A0" "\00A0";
354+
&::before {
355+
content: counter(toc-h2-counter) "\002E" counter(toc-h3-counter) "\002E" counter(toc-h4-counter) "\002E" counter(toc-h5-counter) "\002E" counter(toc-h6-counter) "\00A0" "\00A0";
356+
}
357+
}
358+
}
359+
}
334360
}
335361
}
336362
}
@@ -348,31 +374,51 @@ dd {
348374
*/
349375

350376
.article--with-toc {
351-
counter-reset: heading-counter;
377+
counter-reset: heading-h2-counter;
352378

353379
h2 {
354-
counter-reset: heading-sub-counter;
380+
counter-reset: heading-h3-counter;
355381
}
356382

357383
h2::before {
358-
content: counter(heading-counter) "\00A0" "\00A0";
384+
content: counter(heading-h2-counter) "\00A0" "\00A0";
359385
opacity: 0.66;
360-
counter-increment: heading-counter;
386+
counter-increment: heading-h2-counter;
361387
}
362388

363389
h3 {
364-
counter-reset: heading-sub-sub-counter;
390+
counter-reset: heading-h4-counter;
365391
}
366392

367393
h3::before {
368-
content: counter(heading-counter) "\002E" counter(heading-sub-counter) "\00A0" "\00A0";
394+
content: counter(heading-h2-counter) "\002E" counter(heading-h3-counter) "\00A0" "\00A0";
369395
opacity: 0.66;
370-
counter-increment: heading-sub-counter;
396+
counter-increment: heading-h3-counter;
397+
}
398+
399+
h4 {
400+
counter-reset: heading-h5-counter;
371401
}
372402

373403
h4::before {
374-
content: counter(heading-counter) "\002E" counter(heading-sub-counter) "\002E" counter(heading-sub-sub-counter) "\00A0" "\00A0";
404+
content: counter(heading-h2-counter) "\002E" counter(heading-h3-counter) "\002E" counter(heading-h4-counter) "\00A0" "\00A0";
405+
opacity: 0.66;
406+
counter-increment: heading-h4-counter;
407+
}
408+
409+
h5 {
410+
counter-reset: heading-h6-counter;
411+
}
412+
413+
h5::before {
414+
content: counter(heading-h2-counter) "\002E" counter(heading-h3-counter) "\002E" counter(heading-h4-counter) "\002E" counter(heading-h5-counter) "\00A0" "\00A0";
415+
opacity: 0.66;
416+
counter-increment: heading-h5-counter;
417+
}
418+
419+
h6::before {
420+
content: counter(heading-h2-counter) "\002E" counter(heading-h3-counter) "\002E" counter(heading-h4-counter) "\002E" counter(heading-h5-counter) "\002E" counter(heading-h6-counter) "\00A0" "\00A0";
375421
opacity: 0.66;
376-
counter-increment: heading-sub-sub-counter;
422+
counter-increment: heading-h6-counter;
377423
}
378424
}

0 commit comments

Comments
 (0)