Skip to content

Commit

Permalink
Merge pull request #1197 from readthedocs/nienn/fix-dl-double-margins
Browse files Browse the repository at this point in the history
Fix #1196: Add CSS rule to remove double margins inside dl's
  • Loading branch information
benjaoming committed Aug 19, 2022
2 parents 4efbdbc + 0f76e9b commit 17d51de
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 1 deletion.
21 changes: 21 additions & 0 deletions docs/demo/test_py_module/test.py
Expand Up @@ -65,6 +65,7 @@ def add(self, val1, val2):
:type val2: int
:rtype: int
The parameters of this method are described in the parameter list.
"""

return val1 + val2
Expand Down Expand Up @@ -111,3 +112,23 @@ def another_function(self, a, b, **kwargs):
This is deprecated since 3.0
"""
return sum(kwargs.values()) / len(kwargs), a + b


def add_numbers(a: int, b: int = 0) -> int:
"""Add two numbers together
:param a: The first number
:param b: The second number
Here is some more text.
"""
return a + b


def subtract_numbers(a: int, b: int = 0) -> int:
"""Subtract two numbers
:param a: The first number
:param b: The second number
"""
return a - b
2 changes: 1 addition & 1 deletion sphinx_rtd_theme/static/css/theme.css

Large diffs are not rendered by default.

5 changes: 5 additions & 0 deletions src/sass/_theme_rst.sass
Expand Up @@ -423,6 +423,11 @@
dd
margin: 0 0 ($base-line-height / 2) $base-line-height
line-height: $base-line-height
> p:last-child,
> ol:last-child,
> ul:last-child,
> table:last-child
margin-bottom: 0
html.writer-html4 & dl:not(.docutils),
html.writer-html5 & dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.glossary):not(.simple)
margin-bottom: $base-line-height
Expand Down

0 comments on commit 17d51de

Please sign in to comment.