Spaces:
Runtime error
Runtime error
from __future__ import annotations | |
from typing import Iterable | |
from gradio.themes.base import Base | |
from gradio.themes.utils import colors, fonts, sizes | |
class IndonesiaDark(Base): | |
def __init__( | |
self, | |
*, | |
primary_hue: colors.Color | str = colors.orange, # Use Gradio's orange color for primary elements | |
secondary_hue: colors.Color | str = colors.gray, # Gray for secondary elements | |
neutral_hue: colors.Color | str = colors.gray, # Gray as neutral color | |
spacing_size: sizes.Size | str = sizes.spacing_md, | |
radius_size: sizes.Size | str = sizes.radius_md, | |
text_size: sizes.Size | str = sizes.text_lg, | |
font: fonts.Font | |
| str | |
| Iterable[fonts.Font | str] = ( | |
fonts.GoogleFont("Quicksand"), # Main font | |
"ui-sans-serif", | |
"sans-serif", | |
), | |
font_mono: fonts.Font | |
| str | |
| Iterable[fonts.Font | str] = ( | |
fonts.GoogleFont("IBM Plex Mono"), # Monospaced font for code | |
"ui-monospace", | |
"monospace", | |
), | |
): | |
super().__init__( | |
primary_hue=primary_hue, | |
secondary_hue=secondary_hue, | |
neutral_hue=neutral_hue, | |
spacing_size=spacing_size, | |
radius_size=radius_size, | |
text_size=text_size, | |
font=font, | |
font_mono=font_mono, | |
) | |
# Apply dark theme properties | |
super().set( | |
body_background_fill="#121212", # Dark background for the body | |
block_background_fill="#1a1a1a", # Darker background for blocks | |
block_border_color="#555555", # Gray borders for blocks | |
button_primary_background_fill="#ff8c00", # Orange primary buttons | |
button_primary_background_fill_hover="#ffae42", # Lighter orange on hover | |
button_primary_text_color="white", # White text for buttons | |
slider_color="#ff8c00", # Orange slider | |
block_title_text_color="white", # White text for block titles | |
input_background_fill="#333333", # Dark background for input fields | |
input_border_color="#555555", # Gray borders for inputs | |
block_padding="16px", # Padding for blocks | |
body_text_color="white", # White text color | |
) | |