Skip to content

Commit abee6ab

Browse files
authored
Render loose lists as tight visually (#6648)
1 parent 5bc2f32 commit abee6ab

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

src/styles/custom.css

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,16 @@ dialog::backdrop {
163163
visibility: hidden;
164164
}
165165

166+
/* Tighten loose lists: blank lines between list items in source produce
167+
<li><p>...</p></li> output. Strip the leading/trailing paragraph margins so
168+
single-paragraph items sit flush against each other while items with multiple
169+
paragraphs still get spacing between their internal paragraphs. The class is
170+
repeated to win specificity against Starlight's own li > :last-child rule. */
171+
.sl-markdown-content.sl-markdown-content li > p:first-child { margin-block-start: 0; }
172+
.sl-markdown-content.sl-markdown-content li > p:last-child { margin-block-end: 0; }
173+
.sl-markdown-content.sl-markdown-content li > ul,
174+
.sl-markdown-content.sl-markdown-content li > ol { margin-block-start: 0; }
175+
166176
/* GitHub Alerts - Custom ESPHome Colors (matching Hugo theme style) */
167177
.markdown-alert {
168178
padding: 0.75rem 1rem;

0 commit comments

Comments
 (0)