Spaces:
Paused
Paused
Download src/ui/theme.py from Vittav/ImageSearcherVitor: direct link, hf CLI and curl.
- Browser
- Download file 2.3 kB
-
https://huggingface.co/spaces/Vittav/ImageSearcherVitor/resolve/main/src/ui/theme.py
- Command line
-
hf download hf://spaces/Vittav/ImageSearcherVitor/src/ui/theme.py
-
curl -L -o theme.py https://huggingface.co/spaces/Vittav/ImageSearcherVitor/resolve/main/src/ui/theme.py
2.3 kB
| from pathlib import Path | |
| import gradio as gr | |
| # --- Theme: one palette for light, one for dark --- | |
| theme = gr.themes.Base( | |
| primary_hue=gr.themes.colors.blue, | |
| neutral_hue=gr.themes.colors.slate, | |
| font=[gr.themes.GoogleFont("Inter"), "system-ui", "sans-serif"], | |
| ).set( | |
| # page + text | |
| body_background_fill="#F6F7F9", body_background_fill_dark="#0E1116", | |
| body_text_color="#15181D", body_text_color_dark="#E8EBF0", | |
| body_text_color_subdued="#5B6270", body_text_color_subdued_dark="#9AA3B2", | |
| # blocks: no borders of their own (the card provides the frame) | |
| block_background_fill="#FFFFFF", block_background_fill_dark="#161A21", | |
| block_border_width="0px", | |
| block_shadow="none", | |
| block_label_text_color="#3A404B", block_label_text_color_dark="#C4CAD4", | |
| block_label_text_weight="600", | |
| border_color_primary="#DDE1E7", border_color_primary_dark="#2A303B", | |
| # inputs | |
| input_background_fill="#FFFFFF", input_background_fill_dark="#1D222B", | |
| input_border_color="#C3C9D2", input_border_color_dark="#3A414D", | |
| input_border_width="1px", | |
| input_radius="8px", | |
| input_padding="12px 14px", | |
| # buttons | |
| button_large_radius="8px", | |
| button_small_radius="999px", | |
| button_primary_background_fill="#2457D6", button_primary_background_fill_dark="#4F7DF0", | |
| button_primary_background_fill_hover="#1A3FA0", button_primary_background_fill_hover_dark="#3E6AE0", | |
| button_primary_text_color="#FFFFFF", button_primary_text_color_dark="#FFFFFF", | |
| button_secondary_background_fill="#EEF1F5", button_secondary_background_fill_dark="#222833", | |
| button_secondary_background_fill_hover="#E2E7EE", button_secondary_background_fill_hover_dark="#2C3340", | |
| button_secondary_text_color="#3A404B", button_secondary_text_color_dark="#C4CAD4", | |
| button_secondary_border_color="#DDE1E7", button_secondary_border_color_dark="#2A303B", | |
| slider_color="#2457D6", slider_color_dark="#4F7DF0", | |
| ) | |
| # --- Custom CSS, loaded from the file next to this one --- | |
| CSS = (Path(__file__).parent / "styles.css").read_text() | |
| # --- Small browser-side script for the light/dark button --- | |
| TOGGLE_DARK = "() => document.body.classList.toggle('dark')" |