Snippet to increase spacing between list items?

I want to increase the space between list items, preferably without increasing the space between lines of a single list item.

I can insert a blank line between items, and I note when I output to html for some work Obsidian cleverly avoids setting out repeated single-item lists instead of list items. This is good, but when working in Obsidian a whole line between items takes too much space.

Things I have tried

Various methods of increasing list item spacing. (Padding, line-height, etc.) They seem to work on the list items within Dataview tables, but not on list items in notes bodies.

I have searched the help and looked over the forum. Any help much appreciated.

Can u give some visual cue or illustration on this. If i get u, it should mean space between list item 1 and list item 2 right? But not between paragraph element and list item 1?

paragraph element
- list item 1
- list item 2

I dont have a ready snippet yet, but the hint is to use css combinatory selector e.g. li + li { }

Thanks for responding @efemkay

I’m after the sort of effect that would come from
<li style="padding-bottom: 0.5em;">text of item</li>

But when I make a selector of that sort in a snippet, only the lists inside Dataview tables are affected.

I may run and update and re-try…

This should do it:

/* 10 pixel padding above each list item */
.HyperMD-list-line { padding-top: 10px !important; }
5 Likes

That did it. Thanks!

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.