mirror of
https://github.com/readthedocs/sphinx_rtd_theme.git
synced 2025-02-25 18:55:21 -06:00
Footnote citation spacing (#488)
* Do not wrap footnotes or citations to make them responsive * Remove margin below footnotes and citations, add margin-top to next element * Remove margin-bottom from responsive citation and footnote wrapper * Mark responsive wrapper if used for citation or footnote * Document workaround for footnote and citation spacing * Add vertical space if citation/footnote is last element in parent This keeps correct vertical whitespace if the citation or footnote is the last element in a section. The style rule directly above this line did not match since there is direct sibling. * Clarify Fixes #488
This commit is contained in:
parent
59a37b3af9
commit
a4b8eb468d
@ -79,9 +79,16 @@ function ThemeNav () {
|
||||
})
|
||||
|
||||
// Make tables responsive
|
||||
$("table.docutils:not(.field-list)")
|
||||
$("table.docutils:not(.field-list,.footnote,.citation)")
|
||||
.wrap("<div class='wy-table-responsive'></div>");
|
||||
|
||||
// Add extra class to responsive tables that contain
|
||||
// footnotes or citations so that we can target them for styling
|
||||
$("table.docutils.footnote")
|
||||
.wrap("<div class='wy-table-responsive footnote'></div>");
|
||||
$("table.docutils.citation")
|
||||
.wrap("<div class='wy-table-responsive citation'></div>");
|
||||
|
||||
// Add expand links to all parents of nested ul
|
||||
$('.wy-menu-vertical ul').not('.simple').siblings('a').each(function () {
|
||||
var link = $(this);
|
||||
|
@ -176,6 +176,17 @@
|
||||
vertical-align: top
|
||||
code
|
||||
color: $gray
|
||||
// Remove the large vertical space between citations and footnotes
|
||||
.wy-table-responsive.citation, .wy-table-responsive.footnote
|
||||
margin-bottom: 0
|
||||
// Re-add vertical space to element directly following citation and footnotes,
|
||||
// if the following element is of a different type
|
||||
.wy-table-responsive.citation + :not(.citation),
|
||||
.wy-table-responsive.footnote + :not(.footnote)
|
||||
margin-top: $base-line-height
|
||||
// Re-add vertical space after citation and footnotes if it is the last child of a parent
|
||||
.wy-table-responsive.citation:last-child, .wy-table-responsive.footnote:last-child
|
||||
margin-bottom: $base-line-height
|
||||
table.docutils
|
||||
@extend .wy-table
|
||||
@extend .wy-table-bordered-all
|
||||
|
Loading…
Reference in New Issue
Block a user