Skip to content

Instantly share code, notes, and snippets.

@AnatoliyLitinskiy
Created June 21, 2018 16:31
Show Gist options
  • Save AnatoliyLitinskiy/f88d46428f0c9373598c1af12da5f3b7 to your computer and use it in GitHub Desktop.
Save AnatoliyLitinskiy/f88d46428f0c9373598c1af12da5f3b7 to your computer and use it in GitHub Desktop.
custome css hierarchical counter with different list-style-type
/*
.ol-level-1 > .li-level-1 > .ol-level-2 > .li-level-2, .li-level-2_alpha counters
*/
.ol-level-1, .ol-level-2 {
list-style-type: none;
counter-reset: terms-counter-y 0;
}
.li-level-1, .li-level-2 {
counter-increment: terms-counter-y 1;
}
.li-level-1:before, .li-level-2:before {
content: counters(terms-counter-y, ".") " ";
}
.li-level-2 {
counter-reset: terms-counter-alpha 0;
}
.li-level-2_alpha:before {
counter-increment: terms-counter-alpha;
content: counter(terms-counter-alpha, lower-alpha) "." " ";
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment