diff --git a/src/gui/components/_legacy.py b/src/gui/components/_legacy.py index 1c5ab98..31a2ea4 100644 --- a/src/gui/components/_legacy.py +++ b/src/gui/components/_legacy.py @@ -83,10 +83,18 @@ footer { [data-testid="stSidebarNav"] a[href$="/close/"] { display: none !important; } -/* Reclaim top padding lost from hidden header. Slim the bottom too — - Streamlit's default leaves several rems below the last widget. */ +/* Reclaim top padding lost from hidden header. Streamlit's default + block-container padding-top is ~6rem (room for the header it ships). + We hide the header so reclaim that space — the page title should sit + close to the top edge. Slim the bottom too — Streamlit's default + leaves several rems below the last widget. + The testid was renamed from ``stAppViewBlockContainer`` (legacy) to + ``stMainBlockContainer`` in the current Streamlit release; match + both so the rule keeps working across versions. */ .stAppViewBlockContainer, -[data-testid="stAppViewBlockContainer"] { +[data-testid="stAppViewBlockContainer"], +.stMainBlockContainer, +[data-testid="stMainBlockContainer"] { padding-top: 0.5rem !important; padding-bottom: 0.75rem !important; } @@ -583,7 +591,11 @@ div[data-testid="stContainer"][data-border="true"] { padding: 14px 18px; border-bottom: 1px solid var(--border); background: var(--surface-hover); - margin: -1rem -1rem 0; + /* -1rem on top/sides bleeds the head to the card edges (the parent + ``st.container(border=True)`` has 1rem padding). +0.75rem on the + bottom is the breathing room before the first finding row — + without it the row sits flush against the head's bottom border. */ + margin: -1rem -1rem 0.75rem; border-radius: var(--r-lg) var(--r-lg) 0 0; } .dt-severity-dot {