Customizing ordered list with decimals

I’m trying to set, through css snippets, ordered lists with decimals, 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 on Stackoverflow, 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:

image

Any help will be highly appreciated. Thanks!

Hi, there! Any help will be highly appreciated!