georad commited on
Commit
4bcd70e
·
verified ·
1 Parent(s): b0c81c3

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -2
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="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,7 +36,7 @@ custom_css = f"""
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); */
@@ -45,6 +45,7 @@ custom_css = f"""
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
  }}
 
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="stAppViewContainer"] > 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: green;
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); */
 
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
+ background-color: red !important;
49
  border-style: solid !important;
50
  border-color: red !important;
51
  }}