counters js

This commit is contained in:
Julie Blanc 2026-01-20 21:30:25 +01:00
parent 5b80e66e60
commit 4a95558237
5 changed files with 154 additions and 85 deletions

View file

@ -288,49 +288,11 @@ ol[type="1"]{
}
*/
#section__content {
counter-reset: h1;
#section__content h1::before, #section__content h2::before, #section__content h3::before {
content: attr(data-counter);
}
#section__content h1 {
counter-increment: h1 1;
counter-reset: h2;
}
#section__content h1::before {
content: counter(h1, upper-alpha);
}
#section__content h2 {
counter-increment: h2 1;
counter-reset: h3;
}
#section__content h2::before {
content: counter(h2, upper-roman);
}
#section__content h3 {
counter-increment: h3 1;
counter-reset: h4;
}
#section__content h3::before {
content: counter(h3);
}
#section__content h4 {
counter-increment: h4 1;
counter-reset: h5;
}
#section__content h4::before {
content: counter(h4, lower-alpha) ". ";
}
#section__content h5 {
counter-increment: h5 1;
counter-reset: h6;
}
#section__content h5::before {
content: counter(h5, lower-alpha) counter(h5, lower-alpha) ". ";
}
#section__content h6 {
counter-increment: h6 1;
}
#section__content h6::before {
content: "(" counter(h6) "). ";
#section__content h4::before, #section__content h5::before, #section__content h6::before {
content: attr(data-counter) ". ";
}
#section__content h1, #section__content h2, #section__content h3, #section__content h4 {