Skip to content

Commit

Permalink
Merge pull request #15 from executablebooks/fixing-padding
Browse files Browse the repository at this point in the history
🐛 BUG: Fixing overlapping title on hidden admonitions
  • Loading branch information
choldgraf committed Aug 7, 2020
2 parents b1dde11 + e376ef4 commit 24935d1
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 2 deletions.
13 changes: 13 additions & 0 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -204,3 +204,16 @@ Here's how they look right after one another:
.. toggle::

This is my second.

.. admonition:: A really long admonition that will take up multiple lines A really long admonition that will take up multiple lines
:class: toggle

Admonition content.

.. image:: https://jupyterbook.org/_static/logo.png

.. admonition:: A really long admonition that will take up multiple lines A really long admonition that will take up multiple lines

Admonition content.

.. image:: https://jupyterbook.org/_static/logo.png
10 changes: 8 additions & 2 deletions sphinx_togglebutton/_static/togglebutton.css_t
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,17 @@
}

/* Overrides for admonition toggles */
div.admonition.toggle-hidden {
height: 3em;

/* Titles should cut off earlier to avoid overlapping w/ button */
div.admonition.toggle p.admonition-title {
padding-right: 20%;
}

/* hides all the content of a page until de-toggled */
div.admonition.toggle-hidden .admonition-title ~ * {
height: 0;
margin: 0;
float: left; /* so they overlap when hidden */
opacity: 0;
visibility: hidden;
}
Expand Down

0 comments on commit 24935d1

Please sign in to comment.