georad commited on
Commit
7deb7e8
·
verified ·
1 Parent(s): a9e633f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +30 -33
app.py CHANGED
@@ -1,41 +1,38 @@
1
  import streamlit as st
2
 
3
- # Looking at the UCSF example, they use a custom component approach with specific CSS
4
- # Let's implement a similar solution
5
- custom_css = f"""
6
  <style>
7
- /* CSS similar to UCSF implementation */
8
- div.block-container {
9
- padding-top: 1rem;
10
- }
11
-
12
- div[data-testid="stDecoratedAppViewContainer"] > div:first-child {
13
- position: sticky !important;
14
- top: 0 !important;
15
- background-color: white;
16
- z-index: 999;
17
- padding: 0px !important;
18
- }
19
-
20
- /* Custom header styling */
21
- .custom-header {
22
- background-color: #90EE90;
23
- padding: 1rem;
24
- border-bottom: 1px solid #ddd;
25
- width: 100%;
26
- }
27
-
28
- /* Hide default Streamlit header */
29
- header[data-testid="stHeader"] {
30
- display: none;
31
- }
32
-
33
- /* Additional fixes specific to Hugging Face embedding */
34
- section[data-testid="stSidebar"] {
35
- z-index: 0;
36
- }
37
  </style>
38
  """
 
 
39
  st.markdown(custom_css, unsafe_allow_html=True)
40
 
41
  # Create a custom header at the very top (this is key)
 
1
  import streamlit as st
2
 
3
+ # Fix the CSS to avoid parsing errors
4
+ custom_css = """
 
5
  <style>
6
+ div.block-container {
7
+ padding-top: 1rem;
8
+ }
9
+
10
+ div[data-testid="stDecoratedAppViewContainer"] > div:first-child {
11
+ position: sticky !important;
12
+ top: 0 !important;
13
+ background-color: white;
14
+ z-index: 999;
15
+ padding: 0px !important;
16
+ }
17
+
18
+ .custom-header {
19
+ background-color: #90EE90;
20
+ padding: 1rem;
21
+ border-bottom: 1px solid #ddd;
22
+ width: 100%;
23
+ }
24
+
25
+ header[data-testid="stHeader"] {
26
+ display: none;
27
+ }
28
+
29
+ section[data-testid="stSidebar"] {
30
+ z-index: 0;
31
+ }
 
 
 
 
32
  </style>
33
  """
34
+
35
+ # Apply the CSS with proper escaping
36
  st.markdown(custom_css, unsafe_allow_html=True)
37
 
38
  # Create a custom header at the very top (this is key)