Last active
April 17, 2023 18:23
-
-
Save johnfmorton/b720bf5f3848a4e99791681fd1752057 to your computer and use it in GitHub Desktop.
Format ordered lists in contract format. 1 > 1.1 > 1.1.a
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 { | |
list-style-type: none; | |
counter-reset: custom-counter; | |
} | |
ol li { | |
counter-increment: custom-counter; | |
} | |
ol li::before { | |
content: counter(custom-counter) ". "; | |
} | |
ol ol { | |
counter-reset: nested-counter; | |
} | |
ol ol li { | |
counter-increment: nested-counter; | |
} | |
ol ol li::before { | |
content: counter(custom-counter) "." counter(nested-counter) ". "; | |
} | |
ol ol ol { | |
counter-reset: third-level-counter; | |
} | |
ol ol ol li { | |
counter-increment: third-level-counter; | |
} | |
ol ol ol li::before { | |
content: counter(custom-counter) "." counter(nested-counter) "." | |
counter(third-level-counter, lower-alpha) ". "; | |
margin-left: 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
If you are using this in a CKEditor field, add
.ck.ck-content
to the beginning of each style, like this: