Skip to content

Commit 24935d1

Browse files
authored
Merge pull request #15 from executablebooks/fixing-padding
🐛 BUG: Fixing overlapping title on hidden admonitions
2 parents b1dde11 + e376ef4 commit 24935d1

File tree

2 files changed

+21
-2
lines changed

2 files changed

+21
-2
lines changed

docs/index.rst

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -204,3 +204,16 @@ Here's how they look right after one another:
204204
.. toggle::
205205

206206
This is my second.
207+
208+
.. admonition:: A really long admonition that will take up multiple lines A really long admonition that will take up multiple lines
209+
:class: toggle
210+
211+
Admonition content.
212+
213+
.. image:: https://jupyterbook.org/_static/logo.png
214+
215+
.. admonition:: A really long admonition that will take up multiple lines A really long admonition that will take up multiple lines
216+
217+
Admonition content.
218+
219+
.. image:: https://jupyterbook.org/_static/logo.png

sphinx_togglebutton/_static/togglebutton.css_t

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,17 @@
1212
}
1313

1414
/* Overrides for admonition toggles */
15-
div.admonition.toggle-hidden {
16-
height: 3em;
15+
16+
/* Titles should cut off earlier to avoid overlapping w/ button */
17+
div.admonition.toggle p.admonition-title {
18+
padding-right: 20%;
1719
}
1820

21+
/* hides all the content of a page until de-toggled */
1922
div.admonition.toggle-hidden .admonition-title ~ * {
23+
height: 0;
24+
margin: 0;
25+
float: left; /* so they overlap when hidden */
2026
opacity: 0;
2127
visibility: hidden;
2228
}

0 commit comments

Comments
 (0)