Customizing Obsidian's ordered lists with decimals

103 Views Asked by At

I’m trying to set, through css snippets, ordered lists with decimals on OBSIDIAN, e.g…

1. Item 1
2. Item 2 
   2.1. Sub Item A
   2.2. Sub Item B
         2.2.1. Sub-Sub Item

Following this CSS approach mentioned in another thread, I’ve created a snippet with the following pieces of code:

span.cm-formatting-list-ol.cm-list-1 {
  counter-reset: item !important; 
  }

span.cm-formatting-list-ol.cm-list-2:before { 
  content: counters(item, ".") " "; counter-increment: item 
  }

span.cm-formatting-list-ol.cm-list-3:before { 
  content: counters(item, ".") " "; counter-increment: item 
  }

Unfortunately, it’s doesn’t properly work. I get the following result:

enter image description here

Any help will be highly appreciated. Thanks!

0

There are 0 best solutions below