Spaces:
Running
Running
Upload themes.py
Browse files
themes.py
ADDED
@@ -0,0 +1,55 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
from __future__ import annotations
|
2 |
+
from typing import Iterable
|
3 |
+
from gradio.themes.base import Base
|
4 |
+
from gradio.themes.utils import colors, fonts, sizes
|
5 |
+
|
6 |
+
class IndonesiaTheme(Base):
|
7 |
+
def __init__(
|
8 |
+
self,
|
9 |
+
*,
|
10 |
+
primary_hue: colors.Color | str = colors.red,
|
11 |
+
secondary_hue: colors.Color | str = colors.gray,
|
12 |
+
neutral_hue: colors.Color | str = colors.gray,
|
13 |
+
spacing_size: sizes.Size | str = sizes.spacing_md,
|
14 |
+
radius_size: sizes.Size | str = sizes.radius_md,
|
15 |
+
text_size: sizes.Size | str = sizes.text_lg,
|
16 |
+
font: fonts.Font
|
17 |
+
| str
|
18 |
+
| Iterable[fonts.Font | str] = (
|
19 |
+
fonts.GoogleFont("Quicksand"),
|
20 |
+
"ui-sans-serif",
|
21 |
+
"sans-serif",
|
22 |
+
),
|
23 |
+
font_mono: fonts.Font
|
24 |
+
| str
|
25 |
+
| Iterable[fonts.Font | str] = (
|
26 |
+
fonts.GoogleFont("IBM Plex Mono"),
|
27 |
+
"ui-monospace",
|
28 |
+
"monospace",
|
29 |
+
),
|
30 |
+
):
|
31 |
+
super().__init__(
|
32 |
+
primary_hue=primary_hue,
|
33 |
+
secondary_hue=secondary_hue,
|
34 |
+
neutral_hue=neutral_hue,
|
35 |
+
spacing_size=spacing_size,
|
36 |
+
radius_size=radius_size,
|
37 |
+
text_size=text_size,
|
38 |
+
font=font,
|
39 |
+
font_mono=font_mono,
|
40 |
+
)
|
41 |
+
super().set(
|
42 |
+
body_background_fill="linear-gradient(to bottom, #e0e0e0, #7d7d7d)", # Gradasi abu-abu muda ke abu-abu tua
|
43 |
+
body_background_fill_dark="linear-gradient(to bottom, #7d7d7d, #4a4a4a)", # Gradasi abu-abu tua ke lebih gelap untuk dark mode
|
44 |
+
button_primary_background_fill="linear-gradient(90deg, #d84a4a, #b33030)", # Merah ke merah tua
|
45 |
+
button_primary_background_fill_hover="linear-gradient(90deg, #e85b5b, #cc4b4b)", # Merah lebih terang untuk hover
|
46 |
+
button_primary_text_color="white",
|
47 |
+
button_primary_background_fill_dark="linear-gradient(90deg, #b33030, #8f1f1f)", # Merah tua untuk dark mode
|
48 |
+
slider_color="*secondary_300",
|
49 |
+
slider_color_dark="*secondary_600",
|
50 |
+
block_title_text_weight="600",
|
51 |
+
block_border_width="3px",
|
52 |
+
block_shadow="*shadow_drop_lg",
|
53 |
+
button_shadow="*shadow_drop_lg",
|
54 |
+
button_large_padding="32px",
|
55 |
+
)
|