From dd885173c6359fea9e7948878d8b291602a61bbb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20L=C3=B3pez=20Barr=C3=B3n?= Date: Mon, 23 Dec 2024 10:41:25 +1100 Subject: [PATCH] display none rather than zero width MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Christian López Barrón --- docs/source/_static/custom.css | 45 +++++++++++++++++++--------------- 1 file changed, 25 insertions(+), 20 deletions(-) diff --git a/docs/source/_static/custom.css b/docs/source/_static/custom.css index 2eac2a0b..686838e4 100644 --- a/docs/source/_static/custom.css +++ b/docs/source/_static/custom.css @@ -1,26 +1,31 @@ -/* Default state (with sidebar visible) */ -.sy-main { - width: calc(100% - 20rem); /* Adjust width with sidebar */ - max-width: none; /* Prevent it from exceeding the container's size */ - box-sizing: border-box; /* Ensure padding/margins don’t add to total width */ -} - -/* Responsive state (when sidebar disappears) */ -@media (max-width: 768px) { /* Adjust breakpoint as needed */ - .sy-main { - width: 100%; /* Use full width when sidebar is hidden */ - max-width: none; /* Remove max-width limit */ - } -} - -.sy-rside { - width: 0; /* Keep the sidebar offset */ - max-width: 0; /* Allow the element to fill the remaining space */ -} -/* Take out pointless vertical whitespace in the signatures. */ +/* Take out the additional vertical whitespace for multi-line function signatures. */ /* https://github.com/readthedocs/sphinx_rtd_theme/issues/1529#issuecomment-1918561608 */ .sig dl { margin-bottom: 0; margin-top: 0; margin-left: 2em; } + +/* Hide right sidebar and the button that displays it when screenspace is reduced */ +aside#rside { + display: none !important; +} + +div.xl\:hidden { + display: none !important; +} + +/* Since right sidebar is not displayed, re-declare the width criteria for the main area of the docs to be larger */ +.sy-main { + width: calc(100% - 20rem); /* each (left and right) sidebar is 18rem width, so now keep only 18 (+ 1 of margin for each side) */ + max-width: none; + box-sizing: border-box; +} + +/* For smaller window size, when right sidebar disappears, redeclare the same */ +@media (max-width: 768px) { + .sy-main { + width: 100%; /* now there are no sidebars visible */ + max-width: none; + } +}