Threadbourne commited on
Commit
b151ac2
Β·
verified Β·
1 Parent(s): d24e90b

Upload custom.css

Browse files
Files changed (1) hide show
  1. custom.css +390 -0
custom.css ADDED
@@ -0,0 +1,390 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /* uglytool.dev β€” After Hours theme (v3)
2
+ * See README.md for drop-in instructions for Gradio + Streamlit.
3
+ * You bought this file. Modify whatever you want β€” tweak the amber,
4
+ * swap the font, remove the credit. It's yours now.
5
+ */
6
+
7
+ @import url('https://fonts.googleapis.com/css2?family=Syne:wght@600;700;800&family=DM+Sans:wght@300;400;500&family=DM+Mono:wght@400;500&display=swap');
8
+
9
+ /* ============================================================
10
+ * Part 1 β€” Gradio theme variables (the primary customization hook)
11
+ * Override on :root AND on the dark-mode variant so the cascade
12
+ * picks these up regardless of which flag the host set.
13
+ * ============================================================ */
14
+
15
+ :root,
16
+ :root.dark,
17
+ .gradio-container,
18
+ .gradio-container.dark,
19
+ body.dark {
20
+ /* After Hours palette */
21
+ --ah-bg: #1a1917;
22
+ --ah-bg-raised: #222120;
23
+ --ah-surface: #2a2826;
24
+ --ah-border: rgba(255, 255, 255, 0.07);
25
+ --ah-border-focus: rgba(193, 127, 58, 0.5);
26
+ --ah-amber: #c17f3a;
27
+ --ah-amber-dim: rgba(193, 127, 58, 0.12);
28
+ --ah-text: #f0ece4;
29
+ --ah-muted: #8a8278;
30
+ --ah-dim: #5a5650;
31
+
32
+ /* Gradio β€” colors */
33
+ --body-background-fill: var(--ah-bg);
34
+ --background-fill-primary: var(--ah-bg-raised);
35
+ --background-fill-secondary: var(--ah-surface);
36
+ --body-text-color: var(--ah-text);
37
+ --body-text-color-subdued: var(--ah-muted);
38
+ --color-accent: var(--ah-amber);
39
+ --color-accent-soft: var(--ah-amber-dim);
40
+ --border-color-primary: var(--ah-border);
41
+ --border-color-accent: var(--ah-border-focus);
42
+
43
+ /* Gradio β€” blocks (cards) */
44
+ --block-background-fill: var(--ah-bg-raised);
45
+ --block-border-color: var(--ah-border);
46
+ --block-border-width: 1px;
47
+ --block-radius: 6px;
48
+ --block-shadow: none;
49
+
50
+ /* Gradio β€” block titles + labels (this is where headings/labels live) */
51
+ --block-title-background-fill: transparent;
52
+ --block-title-border-color: transparent;
53
+ --block-title-text-color: var(--ah-text);
54
+ --block-title-text-size: 0.9rem;
55
+ --block-title-text-weight: 700;
56
+ --block-label-background-fill: transparent;
57
+ --block-label-border-color: transparent;
58
+ --block-label-text-color: var(--ah-amber);
59
+ --block-label-text-size: 0.72rem;
60
+ --block-label-text-weight: 500;
61
+
62
+ /* Gradio β€” inputs */
63
+ --input-background-fill: var(--ah-surface);
64
+ --input-background-fill-focus: var(--ah-surface);
65
+ --input-border-color: var(--ah-border);
66
+ --input-border-color-focus: var(--ah-border-focus);
67
+ --input-text-size: 0.88rem;
68
+ --input-radius: 6px;
69
+
70
+ /* Gradio β€” buttons */
71
+ --button-primary-background-fill: var(--ah-amber);
72
+ --button-primary-background-fill-hover: #b87234;
73
+ --button-primary-text-color: var(--ah-bg);
74
+ --button-primary-text-color-hover: var(--ah-bg);
75
+ --button-primary-border-color: var(--ah-amber);
76
+ --button-secondary-background-fill: var(--ah-surface);
77
+ --button-secondary-background-fill-hover: #342f2a;
78
+ --button-secondary-text-color: var(--ah-text);
79
+ --button-secondary-text-color-hover: var(--ah-text);
80
+ --button-secondary-border-color: var(--ah-border);
81
+ --button-large-text-size: 0.9rem;
82
+ --button-large-text-weight: 700;
83
+ --button-large-radius: 6px;
84
+
85
+ /* Sliders */
86
+ --slider-color: var(--ah-amber);
87
+
88
+ /* Typography β€” Gradio only exposes one font variable; we win
89
+ heading specificity via selectors below. */
90
+ --font: 'DM Sans', ui-sans-serif, system-ui, sans-serif;
91
+ --font-mono: 'DM Mono', ui-monospace, monospace;
92
+
93
+ /* Radii */
94
+ --radius-xxs: 2px;
95
+ --radius-xs: 4px;
96
+ --radius-sm: 6px;
97
+ --radius-md: 8px;
98
+ --radius-lg: 10px;
99
+ }
100
+
101
+ /* ============================================================
102
+ * Part 2 β€” Root containers (beat default light/dark mode rules)
103
+ * ============================================================ */
104
+
105
+ html body,
106
+ html body.dark,
107
+ html body .gradio-container,
108
+ html body .gradio-container.dark,
109
+ html body .stApp,
110
+ html body .stApp > div,
111
+ html body [data-testid="stAppViewContainer"] {
112
+ background: var(--ah-bg) !important;
113
+ color: var(--ah-text) !important;
114
+ font-family: 'DM Sans', ui-sans-serif, system-ui, sans-serif !important;
115
+ }
116
+
117
+ html body .main .block-container,
118
+ html body .stApp [data-testid="stVerticalBlock"] {
119
+ background: var(--ah-bg) !important;
120
+ }
121
+
122
+ /* ============================================================
123
+ * Part 3 β€” Typography (html body prefix to win most specificity wars)
124
+ * Headings go to Syne; labels go to DM Mono amber caps.
125
+ *
126
+ * Note: Gradio's default theme styles big markdown headings with
127
+ * -webkit-text-fill-color and/or a clipped background gradient. A
128
+ * plain color: ... !important rule loses because WebKit's text-fill
129
+ * override is what actually paints the text. We also target inner
130
+ * <span> children that Gradio wraps the heading text in.
131
+ * ============================================================ */
132
+
133
+ html body h1, html body h2, html body h3, html body h4, html body h5, html body h6,
134
+ html body .gradio-container h1, html body .gradio-container h2, html body .gradio-container h3,
135
+ html body .gradio-container h4, html body .gradio-container h5, html body .gradio-container h6,
136
+ html body .gradio-container h1 *, html body .gradio-container h2 *, html body .gradio-container h3 *,
137
+ html body .prose h1, html body .prose h2, html body .prose h3, html body .prose h4,
138
+ html body .prose h1 *, html body .prose h2 *, html body .prose h3 *,
139
+ html body .markdown h1, html body .markdown h2, html body .markdown h3,
140
+ html body .markdown h1 *, html body .markdown h2 *, html body .markdown h3 *,
141
+ html body .gr-markdown h1, html body .gr-markdown h2, html body .gr-markdown h3,
142
+ html body .gr-markdown h1 *, html body .gr-markdown h2 *, html body .gr-markdown h3 *,
143
+ html body .stApp h1, html body .stApp h2, html body .stApp h3,
144
+ html body [data-testid="stMarkdownContainer"] h1,
145
+ html body [data-testid="stMarkdownContainer"] h2,
146
+ html body [data-testid="stMarkdownContainer"] h3,
147
+ html body [data-testid="stMarkdownContainer"] h1 *,
148
+ html body [data-testid="stMarkdownContainer"] h2 *,
149
+ html body [data-testid="stMarkdownContainer"] h3 * {
150
+ font-family: 'Syne', ui-sans-serif, sans-serif !important;
151
+ font-weight: 700 !important;
152
+ letter-spacing: -0.02em !important;
153
+ color: var(--ah-text) !important;
154
+ -webkit-text-fill-color: var(--ah-text) !important;
155
+ background-image: none !important;
156
+ background-clip: unset !important;
157
+ -webkit-background-clip: unset !important;
158
+ line-height: 1.15 !important;
159
+ }
160
+
161
+ /* Labels β€” Gradio: .block-label / .svelte-label / <label>.
162
+ Streamlit: [data-testid="stWidgetLabel"]. Cover all known variants. */
163
+ html body .gradio-container .block-label,
164
+ html body .gradio-container .block-label *,
165
+ html body .gradio-container label,
166
+ html body .gradio-container label > *,
167
+ html body .gradio-container [class*="label-wrap"],
168
+ html body .gradio-container [class*="label-wrap"] *,
169
+ html body .gradio-container [data-testid*="label"],
170
+ html body .gradio-container .wrap > label,
171
+ html body .stApp label,
172
+ html body .stApp [data-testid="stWidgetLabel"],
173
+ html body .stApp [data-testid="stWidgetLabel"] > *,
174
+ html body .stApp [data-testid="stWidgetLabel"] p {
175
+ font-family: 'DM Mono', ui-monospace, monospace !important;
176
+ font-size: 0.72rem !important;
177
+ color: var(--ah-amber) !important;
178
+ letter-spacing: 0.12em !important;
179
+ text-transform: uppercase !important;
180
+ font-weight: 500 !important;
181
+ background: transparent !important;
182
+ }
183
+
184
+ /* ============================================================
185
+ * Part 4 β€” Blocks / cards
186
+ * ============================================================ */
187
+
188
+ html body .gradio-container .block,
189
+ html body .gradio-container .gr-block,
190
+ html body .gradio-container .gr-padded,
191
+ html body .gradio-container .gr-form,
192
+ html body .gradio-container .gr-box,
193
+ html body .gradio-container .wrap,
194
+ html body .stApp [data-testid="stForm"],
195
+ html body .stApp [data-testid="stExpander"] {
196
+ background: var(--ah-bg-raised) !important;
197
+ border: 1px solid var(--ah-border) !important;
198
+ border-radius: 6px !important;
199
+ }
200
+
201
+ /* ============================================================
202
+ * Part 5 β€” Inputs
203
+ * ============================================================ */
204
+
205
+ html body .gradio-container input[type="text"],
206
+ html body .gradio-container input[type="number"],
207
+ html body .gradio-container input[type="email"],
208
+ html body .gradio-container input[type="password"],
209
+ html body .gradio-container input[type="search"],
210
+ html body .gradio-container textarea,
211
+ html body .gradio-container select,
212
+ html body .gradio-container .gr-textbox,
213
+ html body .gradio-container .gr-textbox textarea,
214
+ html body .gradio-container .gr-textbox input,
215
+ html body .stApp input[type="text"],
216
+ html body .stApp input[type="number"],
217
+ html body .stApp textarea,
218
+ html body .stApp [data-baseweb="select"] > div,
219
+ html body .stApp [data-baseweb="input"] {
220
+ background: var(--ah-surface) !important;
221
+ border: 1px solid var(--ah-border) !important;
222
+ border-radius: 6px !important;
223
+ color: var(--ah-text) !important;
224
+ font-family: 'DM Mono', ui-monospace, monospace !important;
225
+ font-size: 0.88rem !important;
226
+ caret-color: var(--ah-amber) !important;
227
+ padding: 12px 14px !important;
228
+ }
229
+
230
+ html body .gradio-container textarea,
231
+ html body .stApp textarea {
232
+ min-height: 120px !important;
233
+ line-height: 1.6 !important;
234
+ }
235
+
236
+ html body .gradio-container input:focus,
237
+ html body .gradio-container textarea:focus,
238
+ html body .gradio-container select:focus,
239
+ html body .stApp input:focus,
240
+ html body .stApp textarea:focus {
241
+ border-color: var(--ah-border-focus) !important;
242
+ outline: none !important;
243
+ box-shadow: 0 0 0 1px var(--ah-border-focus) !important;
244
+ }
245
+
246
+ html body .gradio-container ::placeholder,
247
+ html body .stApp ::placeholder {
248
+ color: var(--ah-dim) !important;
249
+ }
250
+
251
+ /* ============================================================
252
+ * Part 6 β€” Buttons
253
+ * ============================================================ */
254
+
255
+ html body .gradio-container button,
256
+ html body .gradio-container .gr-button,
257
+ html body .gradio-container [class*="gr-button"],
258
+ html body .gradio-container button.primary,
259
+ html body .gradio-container .primary,
260
+ html body .stApp .stButton > button,
261
+ html body .stApp button[kind="primary"] {
262
+ background: var(--ah-amber) !important;
263
+ color: var(--ah-bg) !important;
264
+ font-family: 'Syne', ui-sans-serif, sans-serif !important;
265
+ font-weight: 700 !important;
266
+ font-size: 0.9rem !important;
267
+ letter-spacing: 0.04em !important;
268
+ border: none !important;
269
+ border-radius: 6px !important;
270
+ padding: 12px 28px !important;
271
+ cursor: pointer !important;
272
+ transition: opacity 150ms, transform 100ms !important;
273
+ }
274
+
275
+ html body .gradio-container button:hover,
276
+ html body .gradio-container .gr-button:hover,
277
+ html body .stApp .stButton > button:hover {
278
+ opacity: 0.9 !important;
279
+ background: var(--ah-amber) !important;
280
+ color: var(--ah-bg) !important;
281
+ }
282
+
283
+ html body .gradio-container button:active,
284
+ html body .stApp .stButton > button:active {
285
+ transform: scale(0.995) !important;
286
+ }
287
+
288
+ html body .gradio-container button.secondary,
289
+ html body .gradio-container .secondary,
290
+ html body .stApp button[kind="secondary"] {
291
+ background: var(--ah-surface) !important;
292
+ color: var(--ah-text) !important;
293
+ border: 1px solid var(--ah-border) !important;
294
+ }
295
+
296
+ /* ============================================================
297
+ * Part 7 β€” Sliders, checkboxes, radios
298
+ * ============================================================ */
299
+
300
+ html body input[type="range"] { accent-color: var(--ah-amber) !important; }
301
+ html body input[type="range"]::-webkit-slider-thumb {
302
+ background: var(--ah-amber) !important;
303
+ border: 2px solid var(--ah-bg) !important;
304
+ box-shadow: 0 0 0 1px rgba(193, 127, 58, 0.3) !important;
305
+ }
306
+ html body input[type="range"]::-moz-range-thumb {
307
+ background: var(--ah-amber) !important;
308
+ border: 2px solid var(--ah-bg) !important;
309
+ }
310
+ html body input[type="checkbox"],
311
+ html body input[type="radio"] {
312
+ accent-color: var(--ah-amber) !important;
313
+ }
314
+
315
+ /* ============================================================
316
+ * Part 8 β€” File uploads
317
+ * ============================================================ */
318
+
319
+ html body .gradio-container .gr-file-upload,
320
+ html body .gradio-container input[type="file"],
321
+ html body .stApp [data-testid="stFileUploader"],
322
+ html body .stApp [data-testid="stFileUploaderDropzone"] {
323
+ background: var(--ah-surface) !important;
324
+ border: 1px dashed var(--ah-border) !important;
325
+ border-radius: 6px !important;
326
+ color: var(--ah-text) !important;
327
+ }
328
+
329
+ html body input[type="file"]::file-selector-button {
330
+ background: var(--ah-amber-dim) !important;
331
+ color: var(--ah-amber) !important;
332
+ border: 1px solid rgba(193, 127, 58, 0.25) !important;
333
+ border-radius: 4px !important;
334
+ padding: 6px 12px !important;
335
+ margin-right: 12px !important;
336
+ font-family: 'DM Mono', ui-monospace, monospace !important;
337
+ font-size: 0.78rem !important;
338
+ cursor: pointer !important;
339
+ }
340
+
341
+ /* ============================================================
342
+ * Part 9 β€” Markdown, code, links
343
+ * ============================================================ */
344
+
345
+ html body .gradio-container .markdown,
346
+ html body .gradio-container .gr-markdown,
347
+ html body .gradio-container .prose,
348
+ html body .stApp [data-testid="stMarkdownContainer"] {
349
+ color: var(--ah-text) !important;
350
+ font-family: 'DM Sans', ui-sans-serif, sans-serif !important;
351
+ line-height: 1.6 !important;
352
+ }
353
+
354
+ html body .gradio-container a,
355
+ html body .stApp a {
356
+ color: var(--ah-amber) !important;
357
+ }
358
+
359
+ html body code,
360
+ html body .gradio-container code,
361
+ html body .stApp code {
362
+ background: var(--ah-surface) !important;
363
+ color: var(--ah-amber) !important;
364
+ font-family: 'DM Mono', ui-monospace, monospace !important;
365
+ padding: 2px 6px !important;
366
+ border-radius: 3px !important;
367
+ }
368
+
369
+ /* ============================================================
370
+ * Part 10 β€” Scrollbars + Streamlit chrome
371
+ * ============================================================ */
372
+
373
+ html body ::-webkit-scrollbar { width: 8px; height: 8px; }
374
+ html body ::-webkit-scrollbar-track { background: var(--ah-bg); }
375
+ html body ::-webkit-scrollbar-thumb {
376
+ background: rgba(193, 127, 58, 0.3);
377
+ border-radius: 4px;
378
+ }
379
+ html body ::-webkit-scrollbar-thumb:hover {
380
+ background: rgba(193, 127, 58, 0.5);
381
+ }
382
+
383
+ html body .stApp header[data-testid="stHeader"] {
384
+ background: var(--ah-bg) !important;
385
+ border-bottom: 1px solid var(--ah-border) !important;
386
+ }
387
+ html body .stApp [data-testid="stSidebar"] {
388
+ background: var(--ah-bg-raised) !important;
389
+ border-right: 1px solid var(--ah-border) !important;
390
+ }