fix(gui): shrink white-bar compensation to ~1/4 of original gap

Plain ``min-height: 100vh`` left a ~15vh white bar below ``.stApp``
(the zoom: 0.85 scaler shrinks visual height to 85%). Reinstate the
stretching but stop short of the full ``100vh / 0.85`` overflow:
``calc(96vh / 0.85)`` fills 96vh visually and leaves a ~4vh bar — a
quarter the size, no longer dominating the page.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-05-20 23:06:32 +00:00
parent 3a3a9a895b
commit 0be59c0f03

View File

@@ -1704,20 +1704,20 @@ def render_sticky_footer() -> None:
st.markdown(
"""
<style>
/* ``.stApp`` carries ``zoom: 0.85`` (compact-layout scaler). We used to
stretch ``.stApp`` to ``100vh / 0.85`` to hide a small white bar
below it, but that forced every page to be ~17.6% taller than the
viewport — short pages got artificially stretched and the last row
of tall pages slid behind the fixed footer. Now we let containers
size naturally: ``100vh`` is enough to fill the visible area, and
the page-level ``padding-bottom`` set by ``hide_streamlit_chrome``
reserves clear space above the footer. */
/* ``.stApp`` carries ``zoom: 0.85`` (compact-layout scaler), so any
child sized at ``100vh`` only renders at 85vh visually — the bottom
~15vh of the viewport sits OUTSIDE ``.stApp`` and shows ``body``'s
white through. Previously we stretched to ``calc(100vh / 0.85)`` to
close the gap entirely, but that overstretched every page and pushed
the last row past the visible area. Compromise: stretch to cover
MOST of the gap, leaving ~4vh of white bar (≈ 1/4 of the original
~15vh) so short pages stay short but the bar doesn't dominate. */
.stApp {
min-height: 100vh !important;
min-height: calc(96vh / 0.85) !important;
}
[data-testid="stSidebar"],
[data-testid="stMain"] {
min-height: 100vh !important;
min-height: calc(96vh / 0.85) !important;
}
/* DO NOT override ``padding-bottom`` on the block container here — the
``hide_streamlit_chrome`` rule above sets it to 7rem precisely so