Spaces:
Sleeping
Sleeping
Gen. Overseer Lupo
commited on
Commit
Β·
9344898
1
Parent(s):
6275591
Fix CSS inside st.markdown; enforce dark selects; single 240px hero
Browse files- app/ui_streamlit.py +25 -45
app/ui_streamlit.py
CHANGED
|
@@ -9,13 +9,16 @@ from app.search import search
|
|
| 9 |
# ββ Streamlit config ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
|
| 10 |
st.set_page_config(page_title="Grants Discovery App By Lupo", page_icon="π§", layout="wide")
|
| 11 |
|
| 12 |
-
# ββ
|
| 13 |
-
st.markdown("""
|
| 14 |
st.markdown("""
|
| 15 |
<style>
|
| 16 |
-
/*
|
| 17 |
.stApp { background-color: #000000; color: #f8fafc; }
|
|
|
|
|
|
|
| 18 |
html, body, [class*="css"], h1, h2, h3, h4, h5, h6, p, span, div { color: #f8fafc !important; }
|
|
|
|
|
|
|
| 19 |
a, .stRadio > label, .stSlider label { color: #f97316 !important; }
|
| 20 |
|
| 21 |
/* Buttons */
|
|
@@ -25,11 +28,12 @@ a, .stRadio > label, .stSlider label { color: #f97316 !important; }
|
|
| 25 |
}
|
| 26 |
.stButton>button:hover { filter:brightness(1.1); }
|
| 27 |
|
| 28 |
-
/* ===== Inputs: force dark for text, select, multiselect ===== */
|
| 29 |
/* Text input */
|
| 30 |
-
.stTextInput input {
|
|
|
|
|
|
|
| 31 |
|
| 32 |
-
/* Closed control (
|
| 33 |
.stSelectbox div[data-baseweb="select"],
|
| 34 |
.stMultiSelect div[data-baseweb="select"],
|
| 35 |
.stSelectbox div[role="combobox"],
|
|
@@ -40,57 +44,38 @@ a, .stRadio > label, .stSlider label { color: #f97316 !important; }
|
|
| 40 |
border-radius:8px !important;
|
| 41 |
}
|
| 42 |
|
| 43 |
-
/* Text &
|
| 44 |
.stSelectbox div[data-baseweb="select"] div,
|
| 45 |
.stMultiSelect div[data-baseweb="select"] div,
|
| 46 |
.stSelectbox div[data-baseweb="select"] input,
|
| 47 |
.stMultiSelect div[data-baseweb="select"] input,
|
| 48 |
-
.stSelectbox svg, .stMultiSelect svg {
|
| 49 |
-
color:#f8fafc !important; fill:#f8fafc !important;
|
| 50 |
-
}
|
| 51 |
|
| 52 |
/* Placeholder */
|
| 53 |
.stSelectbox div[data-baseweb="select"] input::placeholder,
|
| 54 |
-
.stMultiSelect div[data-baseweb="select"] input::placeholder {
|
| 55 |
-
color:#94a3b8 !important;
|
| 56 |
-
}
|
| 57 |
|
| 58 |
/* Selected chips (multiselect) */
|
| 59 |
-
.stMultiSelect [data-baseweb="tag"] {
|
| 60 |
-
background-color:#334155 !important; color:#e2e8f0 !important; border-radius:999px !important;
|
| 61 |
-
}
|
| 62 |
|
| 63 |
-
/* Open dropdown menu
|
| 64 |
div[data-baseweb="menu"] {
|
| 65 |
-
background-color:#0b1220 !important;
|
| 66 |
-
|
| 67 |
-
border:1px solid #334155 !important;
|
| 68 |
-
border-radius:10px !important;
|
| 69 |
}
|
|
|
|
|
|
|
|
|
|
| 70 |
|
| 71 |
-
/*
|
| 72 |
-
div[data-baseweb="menu"] [role="option"] {
|
| 73 |
-
background:transparent !important; color:#f8fafc !important;
|
| 74 |
-
}
|
| 75 |
-
div[data-baseweb="menu"] [role="option"]:hover {
|
| 76 |
-
background:#1f2937 !important;
|
| 77 |
-
}
|
| 78 |
-
div[data-baseweb="menu"] [role="option"][aria-selected="true"] {
|
| 79 |
-
background:#334155 !important; color:#f8fafc !important;
|
| 80 |
-
}
|
| 81 |
-
|
| 82 |
-
/* ===== Result cards ===== */
|
| 83 |
.result-card {
|
| 84 |
border:1px solid #1e293b; background:#1e293b; border-radius:14px;
|
| 85 |
padding:16px; margin:10px 0; box-shadow:0 1px 2px rgba(0,0,0,0.2);
|
| 86 |
}
|
| 87 |
.result-meta { font-size:13px; color:#94a3b8; margin-top:6px; }
|
| 88 |
-
span.chip {
|
| 89 |
-
display:inline-block; padding:3px 8px; border-radius:999px;
|
| 90 |
-
background:#334155; margin-right:6px; font-size:12px; color:#e2e8f0;
|
| 91 |
-
}
|
| 92 |
|
| 93 |
-
/*
|
| 94 |
.hero {
|
| 95 |
height: 240px;
|
| 96 |
border-radius: 16px;
|
|
@@ -100,17 +85,13 @@ span.chip {
|
|
| 100 |
url('https://images.unsplash.com/photo-1469474968028-56623f02e42e?auto=format&fit=crop&w=1280&q=80')
|
| 101 |
center/cover no-repeat;
|
| 102 |
}
|
| 103 |
-
.hero-text {
|
| 104 |
-
height:100%; display:flex; flex-direction:column;
|
| 105 |
-
align-items:center; justify-content:center; text-align:center; color:#fff;
|
| 106 |
-
}
|
| 107 |
.hero-text h1 { margin:0; font-size:28px; font-weight:700; color:#f97316; }
|
| 108 |
.hero-text p { margin:6px 0 0; font-size:15px; color:#fcd34d; } /* gold */
|
| 109 |
</style>
|
| 110 |
""", unsafe_allow_html=True)
|
| 111 |
|
| 112 |
-
|
| 113 |
-
# ββ Hero block (single!) ββββββββββββββββββββββββββββββββββββββββββββββββββββββ
|
| 114 |
st.markdown("""
|
| 115 |
<div class="hero">
|
| 116 |
<div class="hero-text">
|
|
@@ -124,7 +105,6 @@ st.markdown("""
|
|
| 124 |
SHOW_DEV = os.environ.get("SHOW_DEV") == "1"
|
| 125 |
|
| 126 |
|
| 127 |
-
|
| 128 |
# ββ Environment + index βββββββββββββββββββββββββββββββββββββββββββββββββββββββ
|
| 129 |
_env = get_env()
|
| 130 |
ensure_index_exists(_env)
|
|
|
|
| 9 |
# ββ Streamlit config ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
|
| 10 |
st.set_page_config(page_title="Grants Discovery App By Lupo", page_icon="π§", layout="wide")
|
| 11 |
|
| 12 |
+
# ββ Theme & CSS (BLACK + ORANGE, dark selects) ββββββββββββββββββββββββββββββββ
|
|
|
|
| 13 |
st.markdown("""
|
| 14 |
<style>
|
| 15 |
+
/* App base */
|
| 16 |
.stApp { background-color: #000000; color: #f8fafc; }
|
| 17 |
+
|
| 18 |
+
/* Text defaults */
|
| 19 |
html, body, [class*="css"], h1, h2, h3, h4, h5, h6, p, span, div { color: #f8fafc !important; }
|
| 20 |
+
|
| 21 |
+
/* Accents */
|
| 22 |
a, .stRadio > label, .stSlider label { color: #f97316 !important; }
|
| 23 |
|
| 24 |
/* Buttons */
|
|
|
|
| 28 |
}
|
| 29 |
.stButton>button:hover { filter:brightness(1.1); }
|
| 30 |
|
|
|
|
| 31 |
/* Text input */
|
| 32 |
+
.stTextInput input {
|
| 33 |
+
background:#111827 !important; color:#f8fafc !important; border:1px solid #334155 !important;
|
| 34 |
+
}
|
| 35 |
|
| 36 |
+
/* Closed control (select/multiselect) */
|
| 37 |
.stSelectbox div[data-baseweb="select"],
|
| 38 |
.stMultiSelect div[data-baseweb="select"],
|
| 39 |
.stSelectbox div[role="combobox"],
|
|
|
|
| 44 |
border-radius:8px !important;
|
| 45 |
}
|
| 46 |
|
| 47 |
+
/* Text & icons inside control */
|
| 48 |
.stSelectbox div[data-baseweb="select"] div,
|
| 49 |
.stMultiSelect div[data-baseweb="select"] div,
|
| 50 |
.stSelectbox div[data-baseweb="select"] input,
|
| 51 |
.stMultiSelect div[data-baseweb="select"] input,
|
| 52 |
+
.stSelectbox svg, .stMultiSelect svg { color:#f8fafc !important; fill:#f8fafc !important; }
|
|
|
|
|
|
|
| 53 |
|
| 54 |
/* Placeholder */
|
| 55 |
.stSelectbox div[data-baseweb="select"] input::placeholder,
|
| 56 |
+
.stMultiSelect div[data-baseweb="select"] input::placeholder { color:#94a3b8 !important; }
|
|
|
|
|
|
|
| 57 |
|
| 58 |
/* Selected chips (multiselect) */
|
| 59 |
+
.stMultiSelect [data-baseweb="tag"] { background-color:#334155 !important; color:#e2e8f0 !important; border-radius:999px !important; }
|
|
|
|
|
|
|
| 60 |
|
| 61 |
+
/* Open dropdown menu */
|
| 62 |
div[data-baseweb="menu"] {
|
| 63 |
+
background-color:#0b1220 !important; color:#f8fafc !important;
|
| 64 |
+
border:1px solid #334155 !important; border-radius:10px !important;
|
|
|
|
|
|
|
| 65 |
}
|
| 66 |
+
div[data-baseweb="menu"] [role="option"] { background:transparent !important; color:#f8fafc !important; }
|
| 67 |
+
div[data-baseweb="menu"] [role="option"]:hover { background:#1f2937 !important; }
|
| 68 |
+
div[data-baseweb="menu"] [role="option"][aria-selected="true"] { background:#334155 !important; color:#f8fafc !important; }
|
| 69 |
|
| 70 |
+
/* Result cards */
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 71 |
.result-card {
|
| 72 |
border:1px solid #1e293b; background:#1e293b; border-radius:14px;
|
| 73 |
padding:16px; margin:10px 0; box-shadow:0 1px 2px rgba(0,0,0,0.2);
|
| 74 |
}
|
| 75 |
.result-meta { font-size:13px; color:#94a3b8; margin-top:6px; }
|
| 76 |
+
span.chip { display:inline-block; padding:3px 8px; border-radius:999px; background:#334155; margin-right:6px; font-size:12px; color:#e2e8f0; }
|
|
|
|
|
|
|
|
|
|
| 77 |
|
| 78 |
+
/* Compact hero (single, 240px) */
|
| 79 |
.hero {
|
| 80 |
height: 240px;
|
| 81 |
border-radius: 16px;
|
|
|
|
| 85 |
url('https://images.unsplash.com/photo-1469474968028-56623f02e42e?auto=format&fit=crop&w=1280&q=80')
|
| 86 |
center/cover no-repeat;
|
| 87 |
}
|
| 88 |
+
.hero-text { height:100%; display:flex; flex-direction:column; align-items:center; justify-content:center; text-align:center; color:#fff; }
|
|
|
|
|
|
|
|
|
|
| 89 |
.hero-text h1 { margin:0; font-size:28px; font-weight:700; color:#f97316; }
|
| 90 |
.hero-text p { margin:6px 0 0; font-size:15px; color:#fcd34d; } /* gold */
|
| 91 |
</style>
|
| 92 |
""", unsafe_allow_html=True)
|
| 93 |
|
| 94 |
+
# ββ Hero block (single) βββββββββββββββββββββββββββββββββββββββββββββββββββββββ
|
|
|
|
| 95 |
st.markdown("""
|
| 96 |
<div class="hero">
|
| 97 |
<div class="hero-text">
|
|
|
|
| 105 |
SHOW_DEV = os.environ.get("SHOW_DEV") == "1"
|
| 106 |
|
| 107 |
|
|
|
|
| 108 |
# ββ Environment + index βββββββββββββββββββββββββββββββββββββββββββββββββββββββ
|
| 109 |
_env = get_env()
|
| 110 |
ensure_index_exists(_env)
|