Skip to content

Commit ac20ce7

Browse files
committed
Use only-child to limit margins on single paragraph list items
This is a compromise between the docutils intended style and more consistent margins than 0.4.3.
1 parent aa0a108 commit ac20ce7

3 files changed

Lines changed: 12 additions & 2 deletions

File tree

docs/demo/lists_tables.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,13 @@ Complex
172172
- ``inline literall``
173173
- ``inline literall``
174174
- ``inline literall``
175+
- This item has multiple paragraphs.
176+
177+
This item has multiple paragraphs.
178+
- This item has multiple paragraphs.
179+
180+
This item has multiple paragraphs.
181+
175182

176183
Second list level
177184
^^^^^^^^^^^^^^^^^

sphinx_rtd_theme/static/css/theme.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/sass/_theme_rst.sass

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,10 @@
155155
&:first-child
156156
margin-top: 0rem
157157
> p
158-
margin-bottom: 0rem
158+
&, &:last-child
159+
margin-bottom: $base-line-height / 2
160+
&:only-child, &:only-child:last-child
161+
margin-bottom: 0rem
159162
> ul, > ol
160163
margin-bottom: $base-line-height / 2
161164
// Simple lists, no item margins

0 commit comments

Comments
 (0)