I have asked a couple of CSS wizards and they told me it is not possible. Death_au managed to come up with something but showed that by scrolling it messes up the numbering.
I still don’t fully understand why it can be done in Typora and not in Obsidian, although someone did give me an explanation once.
Apparently in Obsidian it is only possible with JavaScript, so someone would have to make a JS-based plug-in.