|
13 | 13 | "CSS for light and dark mode support using Quarto's data-bs-theme attribute" |
14 | 14 | [] |
15 | 15 | [:style " |
16 | | - /* Light mode (default) */ |
17 | | - [data-bs-theme='light'] { |
| 16 | + /* Light mode (default) - inherits from parent */ |
| 17 | + [data-bs-theme='light'], |
| 18 | + [data-bs-theme='light'] * { |
18 | 19 | --card-bg: #ffffff; |
19 | 20 | --card-secondary-bg: #f9fafb; |
20 | 21 | --input-bg: #ffffff; |
|
29 | 30 | --shadow-color: rgba(0, 0, 0, 0.1); |
30 | 31 | } |
31 | 32 |
|
32 | | - /* Dark mode */ |
33 | | - [data-bs-theme='dark'] { |
| 33 | + /* Dark mode - inherits from parent */ |
| 34 | + [data-bs-theme='dark'], |
| 35 | + [data-bs-theme='dark'] * { |
| 36 | + --card-bg: #1f2937; |
| 37 | + --card-secondary-bg: #111827; |
| 38 | + --input-bg: #111827; |
| 39 | + --text-primary: #f3f4f6; |
| 40 | + --text-secondary: #d1d5db; |
| 41 | + --text-tertiary: #9ca3af; |
| 42 | + --border-color: #374151; |
| 43 | + --border-color-dark: #4b5563; |
| 44 | + --button-bg: #374151; |
| 45 | + --button-hover: #4b5563; |
| 46 | + --button-text: #f3f4f6; |
| 47 | + --shadow-color: rgba(0, 0, 0, 0.3); |
| 48 | + } |
| 49 | +
|
| 50 | + /* Also check for Quarto's dark class on body */ |
| 51 | + .quarto-dark, |
| 52 | + .quarto-dark * { |
34 | 53 | --card-bg: #1f2937; |
35 | 54 | --card-secondary-bg: #111827; |
36 | 55 | --input-bg: #111827; |
|
254 | 273 | (def tabs-container-style |
255 | 274 | {:display "flex" |
256 | 275 | :gap "5px" |
257 | | - :border-bottom "2px solid #374151" |
| 276 | + :border-bottom "2px solid var(--border-color-dark, #4b5563)" |
258 | 277 | :margin-bottom "20px"}) |
259 | 278 |
|
260 | 279 | (defn tab-style [active?] |
261 | 280 | {:padding "12px 24px" |
262 | 281 | :background (if active? "#3b82f6" "transparent") |
263 | | - :color (if active? "white" "#6b7280") |
| 282 | + :color (if active? "white" "var(--text-secondary, #6b7280)") |
264 | 283 | :border "none" |
265 | 284 | :border-bottom (if active? "2px solid #3b82f6" "2px solid transparent") |
266 | 285 | :cursor "pointer" |
|
338 | 357 |
|
339 | 358 | (def metric-label-style |
340 | 359 | {:font-size "12px" |
341 | | - :color "#9ca3af" |
| 360 | + :color "var(--text-tertiary, #9ca3af)" |
342 | 361 | :margin-bottom "5px" |
343 | 362 | :text-transform "uppercase" |
344 | 363 | :font-weight "600"}) |
|
363 | 382 | (def loading-style |
364 | 383 | {:text-align "center" |
365 | 384 | :padding "60px" |
366 | | - :color "#9ca3af"}) |
| 385 | + :color "var(--text-tertiary, #9ca3af)"}) |
367 | 386 |
|
368 | 387 | ;; ============================================================================ |
369 | 388 | ;; Quick Cities |
|
430 | 449 | :on-click #(on-unit-change u)} |
431 | 450 | u])]] |
432 | 451 |
|
433 | | - [:div {:style {:font-size "13px" :color "#9ca3af"}} |
| 452 | + [:div {:style {:font-size "13px" :color "var(--text-tertiary, #9ca3af)"}} |
434 | 453 | "🔄 Auto-refresh: Off"]]) |
435 | 454 |
|
436 | 455 | (defn tabs-navigation [{:keys [active-tab on-tab-change]}] |
|
491 | 510 | (get-weather-icon (:shortForecast period))] |
492 | 511 | [:div {:style {:font-size "24px" :font-weight "600" :color "#3b82f6"}} |
493 | 512 | (format-temp (:temperature period) unit)] |
494 | | - [:div {:style {:font-size "13px" :color "#9ca3af" :margin-top "8px"}} |
| 513 | + [:div {:style {:font-size "13px" :color "var(--text-tertiary, #9ca3af)" :margin-top "8px"}} |
495 | 514 | (:shortForecast period)]])])) |
496 | 515 |
|
497 | 516 | (defn hourly-view [{:keys [hourly unit]}] |
|
518 | 537 | [:div {:style {:font-size "64px"}} "✅"] |
519 | 538 | [:div {:style {:font-size "18px" :font-weight "500" :margin-top "15px"}} |
520 | 539 | "No Active Weather Alerts"] |
521 | | - [:div {:style {:font-size "14px" :color "#9ca3af" :margin-top "8px"}} |
| 540 | + [:div {:style {:font-size "14px" :color "var(--text-tertiary, #9ca3af)" :margin-top "8px"}} |
522 | 541 | "All clear! No weather warnings or advisories."]] |
523 | 542 |
|
524 | 543 | [:div |
|
0 commit comments