With CSS this isn’t achievable. I don’t know whether it would be possible with a plugin, perhaps you could ask on the discord in the plugins channel. It is actually achievable with CSS. Thank you, @Erisred.
This is possible. Here’s one way I found with a quick internet search - slightly modified - I pulled out all styling from the linked post, along with some stuff that was affecting bullets:
/* hierarchical ordering: */
ol {
counter-reset: item
}
ol li {
display: block
}
ol li:before {
content: counters(item, ".") ". ";
counter-increment: item
}
section > ol li::before {
position: relative;
}
It leaves lists with pure bullets alone, but is messy with lists that have both. If you by chance need that I’m sure some deeper searching will show an answer somewhere!
Here’s what I get using the above (in case it isn’t clear, editor on top, preview on bottom)
Hi,
This works well.
It is only missing the option to start numbering from a specific value
But I think the css can not guess that I am continuing the list
@roms - Yes, if you take advantage of the auto-numbering Obsidian provides, things get broken once you get into the sub-items - with this simple code, anyways. Since the first level works here (1., 2., 3. etc), I’m sure this could be modified to accept the generated numbers at each level. Maybe if I get time later I could take a stab at it…
This isn’t a modified file, but a snippet. There are numerous posts in the forum about adding those, but here’s a quick answer:
Outside the vault, navigate to the vault folder, and find the .obsidian folder - inside that should be a folder called snippets - if not, make one, and put a new file in there, named something like lists.css (the .css is critical, the name is not). Inside that .css file, place the above code. Lastly, activate it in the appearance section of your vault.
That’s the nickel tour - again, there are loads of posts on how to use snippets, but feel free to reach out if you still have questions.
Good luck!
Hi! I was wondering if you had any idea why this solution wouldn’t be working for me, I’m currently using the Things Theme and have added the code as you typed it, into its own snippet file but I can’t see to get it to work