Skip to content

Commit

Permalink
display none rather than zero width
Browse files Browse the repository at this point in the history
Signed-off-by: Christian López Barrón <[email protected]>
  • Loading branch information
chrizzFTD committed Dec 22, 2024
1 parent b7e7036 commit dd88517
Showing 1 changed file with 25 additions and 20 deletions.
45 changes: 25 additions & 20 deletions docs/source/_static/custom.css
Original file line number Diff line number Diff line change
@@ -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;
}
}

0 comments on commit dd88517

Please sign in to comment.