Update app.py
Browse files
app.py
CHANGED
|
@@ -180,27 +180,36 @@ def bridge_predict_frame(frame, st):
|
|
| 180 |
# 4. Gradio 介面建構
|
| 181 |
# ==========================================
|
| 182 |
|
| 183 |
-
# 定義強制黑色文字
|
| 184 |
force_black_css = """
|
| 185 |
-
/* 1.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 186 |
.tab-nav button {
|
| 187 |
-
color: #000000 !important;
|
| 188 |
-
|
|
|
|
|
|
|
| 189 |
}
|
| 190 |
|
| 191 |
-
/*
|
| 192 |
.tab-nav button.selected {
|
| 193 |
-
color: #000000 !important;
|
| 194 |
-
|
|
|
|
|
|
|
| 195 |
}
|
| 196 |
|
| 197 |
-
/*
|
| 198 |
-
|
| 199 |
-
|
| 200 |
-
background-color: #f8fafc !important;
|
| 201 |
}
|
| 202 |
|
| 203 |
-
/*
|
| 204 |
h1, h2, h3, h4, h5, h6, .prose h1, .prose h2, .prose h3 {
|
| 205 |
color: #000000 !important;
|
| 206 |
}
|
|
|
|
| 180 |
# 4. Gradio 介面建構
|
| 181 |
# ==========================================
|
| 182 |
|
| 183 |
+
# 定義強制黑色文字與 Tab 修復的 CSS
|
| 184 |
force_black_css = """
|
| 185 |
+
/* 1. 針對 Tab 區域的背景容器:設為淺灰,確保黑字能被看見 */
|
| 186 |
+
.tab-nav {
|
| 187 |
+
background-color: #e2e8f0 !important;
|
| 188 |
+
border-radius: 8px 8px 0 0 !important;
|
| 189 |
+
}
|
| 190 |
+
|
| 191 |
+
/* 2. 【關鍵修正】針對「未選中」的 Tab 按鈕 */
|
| 192 |
.tab-nav button {
|
| 193 |
+
color: #000000 !important; /* 強制文字黑色 */
|
| 194 |
+
background-color: transparent !important; /* 背景透明,透出下方的淺灰 */
|
| 195 |
+
opacity: 1 !important; /* 防止透明度造成看不清 */
|
| 196 |
+
text-shadow: none !important; /* 移除陰影 */
|
| 197 |
}
|
| 198 |
|
| 199 |
+
/* 3. 針對「已選中」的 Tab 按鈕 (圖片中左邊那個) */
|
| 200 |
.tab-nav button.selected {
|
| 201 |
+
color: #000000 !important; /* 文字黑色 (如果你想保留橘色,改成 #ff7f00) */
|
| 202 |
+
background-color: #ffffff !important; /* 背景純白,做出區隔 */
|
| 203 |
+
font-weight: bold !important; /* 加粗 */
|
| 204 |
+
border-bottom: 2px solid #ff7f00 !important; /* 底部橘線 */
|
| 205 |
}
|
| 206 |
|
| 207 |
+
/* 4. 強制 Tab 內的 Icon/Emoji 也變色 */
|
| 208 |
+
.tab-nav button span {
|
| 209 |
+
color: inherit !important;
|
|
|
|
| 210 |
}
|
| 211 |
|
| 212 |
+
/* 5. 確保內容的大標題也是黑色 (H1-H3) */
|
| 213 |
h1, h2, h3, h4, h5, h6, .prose h1, .prose h2, .prose h3 {
|
| 214 |
color: #000000 !important;
|
| 215 |
}
|