Spaces:
Running
Running
from __future__ import annotations | |
from typing import Iterable | |
from gradio.themes.base import Base | |
from gradio.themes.utils import colors, fonts, sizes | |
class IndonesiaTheme(Base): | |
def __init__( | |
self, | |
*, | |
primary_hue: colors.Color | str = colors.purple, | |
secondary_hue: colors.Color | str = colors.pink, | |
neutral_hue: colors.Color | str = colors.gray, | |
spacing_size: sizes.Size | str = sizes.spacing_md, | |
radius_size: sizes.Size | str = sizes.radius_md, | |
text_size: sizes.Size | str = sizes.text_md, | |
font: fonts.Font | |
| str | |
| Iterable[fonts.Font | str] = ( | |
fonts.GoogleFont("Poppins"), | |
"ui-sans-serif", | |
"sans-serif", | |
), | |
font_mono: fonts.Font | |
| str | |
| Iterable[fonts.Font | str] = ( | |
fonts.GoogleFont("Fira 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, | |
) | |
super().set( | |
body_background_fill="linear-gradient(to bottom, #ffffff, #ffebee)", # Gradasi dari putih ke merah muda | |
body_background_fill_dark="linear-gradient(to bottom, #b71c1c, #f44336)", # Gradasi merah gelap ke merah terang untuk mode gelap | |
button_primary_background_fill="linear-gradient(90deg, #d32f2f, #b71c1c)", # Gradasi merah untuk tombol utama | |
button_primary_background_fill_hover="linear-gradient(90deg, #e57373, #d32f2f)", # Gradasi merah lebih terang untuk hover state | |
button_primary_text_color="white", | |
button_primary_background_fill_dark="linear-gradient(90deg, #c62828, #b71c1c)", # Gradasi merah lebih gelap untuk mode gelap | |
slider_color="*secondary_300", | |
slider_color_dark="*secondary_600", | |
block_title_text_weight="600", | |
block_border_width="2px", | |
block_shadow="0px 4px 12px rgba(0, 0, 0, 0.1)", # Bayangan lembut untuk blok | |
button_shadow="0px 4px 12px rgba(0, 0, 0, 0.2)", # Bayangan lembut untuk tombol | |
button_large_padding="20px 40px", | |
) | |