Spaces:
Sleeping
Sleeping
Download ui/theme.py from nandutt/bbca-forecast: direct link, hf CLI and curl.
- Browser
- Download file 1.71 kB
-
https://huggingface.co/spaces/nandutt/bbca-forecast/resolve/main/ui/theme.py
- Command line
-
hf download hf://spaces/nandutt/bbca-forecast/ui/theme.py
-
curl -L -o theme.py https://huggingface.co/spaces/nandutt/bbca-forecast/resolve/main/ui/theme.py
1.71 kB
| """Gradio theme: the same dark desk palette in light and dark mode.""" | |
| import gradio as gr | |
| FONTS_HEAD = ( | |
| '<link rel="preconnect" href="https://fonts.googleapis.com">' | |
| '<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>' | |
| '<link rel="stylesheet" href="https://fonts.googleapis.com/css2?' | |
| "family=Archivo:wdth,wght@118,800&family=IBM+Plex+Mono:wght@400;500;600;700" | |
| '&family=IBM+Plex+Sans:wght@400;500;600&display=swap">' | |
| ) | |
| _SAME = { | |
| "body_background_fill": "#0A0E13", | |
| "body_text_color": "#E8EEF4", | |
| "body_text_color_subdued": "#7F8FA0", | |
| "background_fill_primary": "#10171F", | |
| "background_fill_secondary": "#141D27", | |
| "block_background_fill": "#10171F", | |
| "block_border_color": "#1F2B37", | |
| "block_label_text_color": "#7F8FA0", | |
| "block_title_text_color": "#E8EEF4", | |
| "border_color_primary": "#1F2B37", | |
| "input_background_fill": "#0A0E13", | |
| "input_border_color": "#1F2B37", | |
| "slider_color": "#C8F53C", | |
| "checkbox_background_color_selected": "#C8F53C", | |
| "checkbox_border_color_selected": "#C8F53C", | |
| "color_accent": "#C8F53C", | |
| "color_accent_soft": "rgba(200,245,60,.14)", | |
| "link_text_color": "#C8F53C", | |
| } | |
| def build_theme() -> gr.themes.Base: | |
| theme = gr.themes.Base( | |
| font=[gr.themes.GoogleFont("IBM Plex Sans"), "system-ui", "sans-serif"], | |
| font_mono=[gr.themes.GoogleFont("IBM Plex Mono"), "ui-monospace", "monospace"], | |
| radius_size=gr.themes.sizes.radius_md, | |
| ) | |
| values = {} | |
| for key, val in _SAME.items(): | |
| values[key] = val | |
| if key != "color_accent": # the only variable without a _dark twin | |
| values[f"{key}_dark"] = val | |
| return theme.set(**values) | |