Created
June 21, 2018 16:31
-
-
Save AnatoliyLitinskiy/f88d46428f0c9373598c1af12da5f3b7 to your computer and use it in GitHub Desktop.
custome css hierarchical counter with different list-style-type
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
.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