Spaces:
Sleeping
Sleeping
Create theme.py
Browse files
theme.py
ADDED
@@ -0,0 +1,66 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import gradio as gr
|
2 |
+
from gradio.themes.base import Base
|
3 |
+
from gradio.themes.utils import colors, fonts, sizes
|
4 |
+
|
5 |
+
# Custom Theme Class
|
6 |
+
class FastRTCOrangeTheme(Base):
|
7 |
+
def __init__(
|
8 |
+
self,
|
9 |
+
*,
|
10 |
+
primary_hue=colors.orange,
|
11 |
+
secondary_hue=colors.amber,
|
12 |
+
neutral_hue=colors.gray,
|
13 |
+
spacing_size=sizes.spacing_md,
|
14 |
+
radius_size=sizes.radius_lg,
|
15 |
+
text_size=sizes.text_md,
|
16 |
+
font=(fonts.GoogleFont("Poppins"), "ui-sans-serif", "sans-serif"),
|
17 |
+
font_mono=(fonts.GoogleFont("Fira Code"), "ui-monospace", "monospace"),
|
18 |
+
):
|
19 |
+
super().__init__(
|
20 |
+
primary_hue=primary_hue,
|
21 |
+
secondary_hue=secondary_hue,
|
22 |
+
neutral_hue=neutral_hue,
|
23 |
+
spacing_size=spacing_size,
|
24 |
+
radius_size=radius_size,
|
25 |
+
text_size=text_size,
|
26 |
+
font=font,
|
27 |
+
font_mono=font_mono,
|
28 |
+
)
|
29 |
+
|
30 |
+
super().set(
|
31 |
+
# Background & Layout
|
32 |
+
body_background_fill="linear-gradient(135deg, #FFF7ED, #FFEDD5)",
|
33 |
+
body_text_color="#000000",
|
34 |
+
|
35 |
+
# Block / Panels
|
36 |
+
block_background_fill="white",
|
37 |
+
block_shadow="0 4px 12px rgba(0, 0, 0, 0.05)",
|
38 |
+
block_border_width="1px",
|
39 |
+
block_title_text_weight="700",
|
40 |
+
|
41 |
+
# Buttons (Primary: Orange)
|
42 |
+
button_primary_background_fill="linear-gradient(90deg, #F97316, #FB923C)", # Orange gradient
|
43 |
+
button_primary_background_fill_hover="linear-gradient(90deg, #EA580C, #F97316)",
|
44 |
+
button_primary_text_color="white",
|
45 |
+
button_primary_shadow="0 2px 6px rgba(251, 146, 60, 0.4)",
|
46 |
+
|
47 |
+
# Buttons (Secondary: Subtle Neutral)
|
48 |
+
button_secondary_background_fill="#F8FAFC",
|
49 |
+
button_secondary_text_color="#1F2937",
|
50 |
+
button_secondary_shadow="0 1px 3px rgba(0, 0, 0, 0.1)",
|
51 |
+
|
52 |
+
# Sliders, Inputs
|
53 |
+
slider_color="#F97316", # Orange slider
|
54 |
+
input_border_color="#E2E8F0",
|
55 |
+
input_border_color_focus="#F97316",
|
56 |
+
input_shadow="0 0 0 2px rgba(249, 115, 22, 0.2)",
|
57 |
+
|
58 |
+
# Loader & Progress
|
59 |
+
loader_color="#FB923C",
|
60 |
+
|
61 |
+
# Links & Highlights
|
62 |
+
link_text_color="#F97316",
|
63 |
+
link_text_color_hover="#EA580C"
|
64 |
+
)
|
65 |
+
|
66 |
+
fast_rtc_theme = FastRTCOrangeTheme()
|