georad commited on
Commit
b0c81c3
·
verified ·
1 Parent(s): 90df5a6

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -4
app.py CHANGED
@@ -21,7 +21,7 @@ HEADER_SELECTOR = 'header[data-testid="stHeader"]'
21
  # ---- SELECTOR FOR THE MAIN CONTENT AREA THAT NEEDS PADDING ----
22
  # This targets the first direct div child of the stAppViewContainer,
23
  # which often holds the main scrollable content.
24
- MAIN_CONTENT_SELECTOR = 'section[data-testid="stVerticalBlockBorderWrapper"] > div:nth-child(1)'
25
  # Alternative if the above doesn't work or if your content is further nested:
26
  # MAIN_CONTENT_SELECTOR = 'section[data-testid="stAppViewContainer"] .main-content-wrapper-class'
27
  # Or, very commonly, Streamlit wraps main content in a div with class "block-container":
@@ -36,7 +36,8 @@ custom_css = f"""
36
  position: sticky !important;
37
  top: 0 !important;
38
  z-index: 9999 !important; /* Very high z-index */
39
- background-color: #0f1116 !important; /* Or your app's header background color */
 
40
  /* Add a subtle shadow to make it feel more distinct when content scrolls under */
41
  /* box-shadow: 0 2px 4px -1px rgba(0,0,0,0.1); */
42
  }}
@@ -44,8 +45,8 @@ custom_css = f"""
44
  /* Adding padding to the main content area to prevent overlap with the sticky header */
45
  {MAIN_CONTENT_SELECTOR} {{
46
  padding-top: {HEADER_HEIGHT} !important;
47
- border-style: solid;
48
- border-color: red;
49
  }}
50
 
51
  /* Optional: If your app is set to wide mode and the header isn't spanning full width */
 
21
  # ---- SELECTOR FOR THE MAIN CONTENT AREA THAT NEEDS PADDING ----
22
  # This targets the first direct div child of the stAppViewContainer,
23
  # which often holds the main scrollable content.
24
+ MAIN_CONTENT_SELECTOR = 'section[data-testid="stVerticalBlock"] > div:nth-child(1)'
25
  # Alternative if the above doesn't work or if your content is further nested:
26
  # MAIN_CONTENT_SELECTOR = 'section[data-testid="stAppViewContainer"] .main-content-wrapper-class'
27
  # Or, very commonly, Streamlit wraps main content in a div with class "block-container":
 
36
  position: sticky !important;
37
  top: 0 !important;
38
  z-index: 9999 !important; /* Very high z-index */
39
+ background-color: blue;
40
+ #background-color: #0f1116 !important; /* Or your app's header background color */
41
  /* Add a subtle shadow to make it feel more distinct when content scrolls under */
42
  /* box-shadow: 0 2px 4px -1px rgba(0,0,0,0.1); */
43
  }}
 
45
  /* Adding padding to the main content area to prevent overlap with the sticky header */
46
  {MAIN_CONTENT_SELECTOR} {{
47
  padding-top: {HEADER_HEIGHT} !important;
48
+ border-style: solid !important;
49
+ border-color: red !important;
50
  }}
51
 
52
  /* Optional: If your app is set to wide mode and the header isn't spanning full width */