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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
|
2 |
+
from typing import Iterable
|
3 |
+
import gradio as gr
|
4 |
+
|
5 |
+
# gr.themes.builder()
|
6 |
+
from gradio.themes.base import Base
|
7 |
+
from gradio.themes.utils import colors, fonts, sizes
|
8 |
+
import time
|
9 |
+
|
10 |
+
|
11 |
+
|
12 |
+
|
13 |
+
# Applio Theme
|
14 |
+
class Applio(Base):
|
15 |
+
def __init__(
|
16 |
+
self,
|
17 |
+
*,
|
18 |
+
primary_hue: colors.Color | str = colors.neutral,
|
19 |
+
secondary_hue: colors.Color | str = colors.neutral,
|
20 |
+
neutral_hue: colors.Color | str = colors.neutral,
|
21 |
+
spacing_size: sizes.Size | str = sizes.spacing_md,
|
22 |
+
radius_size: sizes.Size | str = sizes.radius_md,
|
23 |
+
text_size: sizes.Size | str = sizes.text_lg,
|
24 |
+
font: fonts.Font | str | Iterable[fonts.Font | str] = (
|
25 |
+
"Syne V",
|
26 |
+
fonts.GoogleFont("Syne"),
|
27 |
+
"ui-sans-serif",
|
28 |
+
"system-ui",
|
29 |
+
),
|
30 |
+
font_mono: fonts.Font | str | Iterable[fonts.Font | str] = (
|
31 |
+
"ui-monospace",
|
32 |
+
fonts.GoogleFont("Nunito Sans"),
|
33 |
+
),
|
34 |
+
):
|
35 |
+
super().__init__(
|
36 |
+
primary_hue=primary_hue,
|
37 |
+
secondary_hue=secondary_hue,
|
38 |
+
neutral_hue=neutral_hue,
|
39 |
+
spacing_size=spacing_size,
|
40 |
+
radius_size=radius_size,
|
41 |
+
text_size=text_size,
|
42 |
+
font=font,
|
43 |
+
font_mono=font_mono,
|
44 |
+
)
|
45 |
+
self.name = ("Applio",)
|
46 |
+
self.secondary_100 = ("#dbeafe",)
|
47 |
+
self.secondary_200 = ("#bfdbfe",)
|
48 |
+
self.secondary_300 = ("#93c5fd",)
|
49 |
+
self.secondary_400 = ("#60a5fa",)
|
50 |
+
self.secondary_50 = ("#eff6ff",)
|
51 |
+
self.secondary_500 = ("#3b82f6",)
|
52 |
+
self.secondary_600 = ("#2563eb",)
|
53 |
+
self.secondary_700 = ("#1d4ed8",)
|
54 |
+
self.secondary_800 = ("#1e40af",)
|
55 |
+
self.secondary_900 = ("#1e3a8a",)
|
56 |
+
self.secondary_950 = ("#1d3660",)
|
57 |
+
|
58 |
+
super().set(
|
59 |
+
# Blaise
|
60 |
+
background_fill_primary="#110F0F",
|
61 |
+
background_fill_primary_dark="#110F0F",
|
62 |
+
background_fill_secondary="#110F0F",
|
63 |
+
background_fill_secondary_dark="#110F0F",
|
64 |
+
block_background_fill="*neutral_800",
|
65 |
+
block_background_fill_dark="*neutral_800",
|
66 |
+
block_border_color="*border_color_primary",
|
67 |
+
block_border_color_dark="*border_color_primary",
|
68 |
+
block_border_width="1px",
|
69 |
+
block_border_width_dark="1px",
|
70 |
+
block_info_text_color="*body_text_color_subdued",
|
71 |
+
block_info_text_color_dark="*body_text_color_subdued",
|
72 |
+
block_info_text_size="*text_sm",
|
73 |
+
block_info_text_weight="400",
|
74 |
+
block_label_background_fill="*background_fill_primary",
|
75 |
+
block_label_background_fill_dark="*background_fill_secondary",
|
76 |
+
block_label_border_color="*border_color_primary",
|
77 |
+
block_label_border_color_dark="*border_color_primary",
|
78 |
+
block_label_border_width="1px",
|
79 |
+
block_label_border_width_dark="1px",
|
80 |
+
block_label_margin="0",
|
81 |
+
block_label_padding="*spacing_sm *spacing_lg",
|
82 |
+
block_label_radius="calc(*radius_lg - 1px) 0 calc(*radius_lg - 1px) 0",
|
83 |
+
block_label_right_radius="0 calc(*radius_lg - 1px) 0 calc(*radius_lg - 1px)",
|
84 |
+
block_label_shadow="*block_shadow",
|
85 |
+
block_label_text_color="*#110F0F",
|
86 |
+
block_label_text_color_dark="*#110F0F",
|
87 |
+
block_label_text_weight="400",
|
88 |
+
block_padding="*spacing_xl",
|
89 |
+
block_radius="*radius_md",
|
90 |
+
block_shadow="none",
|
91 |
+
block_shadow_dark="none",
|
92 |
+
block_title_background_fill="rgb(255,255,255)",
|
93 |
+
block_title_background_fill_dark="rgb(255,255,255)",
|
94 |
+
block_title_border_color="none",
|
95 |
+
block_title_border_color_dark="none",
|
96 |
+
block_title_border_width="0px",
|
97 |
+
block_title_padding="*block_label_padding",
|
98 |
+
block_title_radius="*block_label_radius",
|
99 |
+
block_title_text_color="#110F0F",
|
100 |
+
block_title_text_color_dark="#110F0F",
|
101 |
+
block_title_text_size="*text_md",
|
102 |
+
block_title_text_weight="600",
|
103 |
+
body_background_fill="#110F0F",
|
104 |
+
body_background_fill_dark="#110F0F",
|
105 |
+
body_text_color="white",
|
106 |
+
body_text_color_dark="white",
|
107 |
+
body_text_color_subdued="*neutral_400",
|
108 |
+
body_text_color_subdued_dark="*neutral_400",
|
109 |
+
body_text_size="*text_md",
|
110 |
+
body_text_weight="400",
|
111 |
+
border_color_accent="*neutral_600",
|
112 |
+
border_color_accent_dark="*neutral_600",
|
113 |
+
border_color_primary="*neutral_800",
|
114 |
+
border_color_primary_dark="*neutral_800",
|
115 |
+
button_border_width="*input_border_width",
|
116 |
+
button_border_width_dark="*input_border_width",
|
117 |
+
button_cancel_background_fill="*button_secondary_background_fill",
|
118 |
+
button_cancel_background_fill_dark="*button_secondary_background_fill",
|
119 |
+
button_cancel_background_fill_hover="*button_cancel_background_fill",
|
120 |
+
button_cancel_background_fill_hover_dark="*button_cancel_background_fill",
|
121 |
+
button_cancel_border_color="*button_secondary_border_color",
|
122 |
+
button_cancel_border_color_dark="*button_secondary_border_color",
|
123 |
+
button_cancel_border_color_hover="*button_cancel_border_color",
|
124 |
+
button_cancel_border_color_hover_dark="*button_cancel_border_color",
|
125 |
+
button_cancel_text_color="#110F0F",
|
126 |
+
button_cancel_text_color_dark="#110F0F",
|
127 |
+
button_cancel_text_color_hover="#110F0F",
|
128 |
+
button_cancel_text_color_hover_dark="#110F0F",
|
129 |
+
button_large_padding="*spacing_lg calc(2 * *spacing_lg)",
|
130 |
+
button_large_radius="*radius_lg",
|
131 |
+
button_large_text_size="*text_lg",
|
132 |
+
button_large_text_weight="600",
|
133 |
+
button_primary_background_fill="*primary_600",
|
134 |
+
button_primary_background_fill_dark="*primary_600",
|
135 |
+
button_primary_background_fill_hover="*primary_500",
|
136 |
+
button_primary_background_fill_hover_dark="*primary_500",
|
137 |
+
button_primary_border_color="*primary_500",
|
138 |
+
button_primary_border_color_dark="*primary_500",
|
139 |
+
button_primary_border_color_hover="*primary_400",
|
140 |
+
button_primary_border_color_hover_dark="*primary_400",
|
141 |
+
button_primary_text_color="white",
|
142 |
+
button_primary_text_color_dark="white",
|
143 |
+
button_primary_text_color_hover="#110F0F",
|
144 |
+
button_primary_text_color_hover_dark="#110F0F",
|
145 |
+
button_secondary_background_fill="transparent",
|
146 |
+
button_secondary_background_fill_dark="transparent",
|
147 |
+
button_secondary_background_fill_hover="*neutral_800",
|
148 |
+
button_secondary_background_fill_hover_dark="*neutral_800",
|
149 |
+
button_secondary_border_color="*neutral_700",
|
150 |
+
button_secondary_border_color_dark="*neutral_700",
|
151 |
+
button_secondary_border_color_hover="*neutral_600",
|
152 |
+
button_secondary_border_color_hover_dark="*neutral_600",
|
153 |
+
button_secondary_text_color="white",
|
154 |
+
button_secondary_text_color_dark="white",
|
155 |
+
button_secondary_text_color_hover="*button_secondary_text_color",
|
156 |
+
button_secondary_text_color_hover_dark="*button_secondary_text_color",
|
157 |
+
button_shadow="none",
|
158 |
+
button_shadow_active="*shadow_inset",
|
159 |
+
button_shadow_hover="none",
|
160 |
+
button_small_padding="*spacing_sm calc(2 * *spacing_sm)",
|
161 |
+
button_small_radius="*radius_lg",
|
162 |
+
button_small_text_size="*text_md",
|
163 |
+
button_small_text_weight="400",
|
164 |
+
button_transition="0.3s ease all",
|
165 |
+
checkbox_background_color="*neutral_700",
|
166 |
+
checkbox_background_color_dark="*neutral_700",
|
167 |
+
checkbox_background_color_focus="*checkbox_background_color",
|
168 |
+
checkbox_background_color_focus_dark="*checkbox_background_color",
|
169 |
+
checkbox_background_color_hover="*checkbox_background_color",
|
170 |
+
checkbox_background_color_hover_dark="*checkbox_background_color",
|
171 |
+
checkbox_background_color_selected="*secondary_600",
|
172 |
+
checkbox_background_color_selected_dark="*secondary_600",
|
173 |
+
checkbox_border_color="*neutral_700",
|
174 |
+
checkbox_border_color_dark="*neutral_700",
|
175 |
+
checkbox_border_color_focus="*secondary_500",
|
176 |
+
checkbox_border_color_focus_dark="*secondary_500",
|
177 |
+
checkbox_border_color_hover="*neutral_600",
|
178 |
+
checkbox_border_color_hover_dark="*neutral_600",
|
179 |
+
checkbox_border_color_selected="*secondary_600",
|
180 |
+
checkbox_border_color_selected_dark="*secondary_600",
|
181 |
+
checkbox_border_radius="*radius_sm",
|
182 |
+
checkbox_border_width="*input_border_width",
|
183 |
+
checkbox_border_width_dark="*input_border_width",
|
184 |
+
checkbox_check="url(\"data:image/svg+xml,%3csvg viewBox='0 0 16 16' fill='white' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M12.207 4.793a1 1 0 010 1.414l-5 5a1 1 0 01-1.414 0l-2-2a1 1 0 011.414-1.414L6.5 9.086l4.293-4.293a1 1 0 011.414 0z'/%3e%3c/svg%3e\")",
|
185 |
+
checkbox_label_background_fill="transparent",
|
186 |
+
checkbox_label_background_fill_dark="transparent",
|
187 |
+
checkbox_label_background_fill_hover="transparent",
|
188 |
+
checkbox_label_background_fill_hover_dark="transparent",
|
189 |
+
checkbox_label_background_fill_selected="transparent",
|
190 |
+
checkbox_label_background_fill_selected_dark="transparent",
|
191 |
+
checkbox_label_border_color="transparent",
|
192 |
+
checkbox_label_border_color_dark="transparent",
|
193 |
+
checkbox_label_border_color_hover="transparent",
|
194 |
+
checkbox_label_border_color_hover_dark="transparent",
|
195 |
+
checkbox_label_border_width="transparent",
|
196 |
+
checkbox_label_border_width_dark="transparent",
|
197 |
+
checkbox_label_gap="*spacing_lg",
|
198 |
+
checkbox_label_padding="*spacing_md calc(2 * *spacing_md)",
|
199 |
+
checkbox_label_shadow="none",
|
200 |
+
checkbox_label_text_color="*body_text_color",
|
201 |
+
checkbox_label_text_color_dark="*body_text_color",
|
202 |
+
checkbox_label_text_color_selected="*checkbox_label_text_color",
|
203 |
+
checkbox_label_text_color_selected_dark="*checkbox_label_text_color",
|
204 |
+
checkbox_label_text_size="*text_md",
|
205 |
+
checkbox_label_text_weight="400",
|
206 |
+
checkbox_shadow="*input_shadow",
|
207 |
+
color_accent="*primary_500",
|
208 |
+
color_accent_soft="*primary_50",
|
209 |
+
color_accent_soft_dark="*neutral_700",
|
210 |
+
container_radius="*radius_xl",
|
211 |
+
embed_radius="*radius_lg",
|
212 |
+
error_background_fill="*background_fill_primary",
|
213 |
+
error_background_fill_dark="*background_fill_primary",
|
214 |
+
error_border_color="*border_color_primary",
|
215 |
+
error_border_color_dark="*border_color_primary",
|
216 |
+
error_border_width="1px",
|
217 |
+
error_border_width_dark="1px",
|
218 |
+
error_text_color="#ef4444",
|
219 |
+
error_text_color_dark="#ef4444",
|
220 |
+
form_gap_width="0px",
|
221 |
+
input_background_fill="*neutral_900",
|
222 |
+
input_background_fill_dark="*neutral_900",
|
223 |
+
input_background_fill_focus="*secondary_600",
|
224 |
+
input_background_fill_focus_dark="*secondary_600",
|
225 |
+
input_background_fill_hover="*input_background_fill",
|
226 |
+
input_background_fill_hover_dark="*input_background_fill",
|
227 |
+
input_border_color="*neutral_700",
|
228 |
+
input_border_color_dark="*neutral_700",
|
229 |
+
input_border_color_focus="*secondary_600",
|
230 |
+
input_border_color_focus_dark="*primary_600",
|
231 |
+
input_border_color_hover="*input_border_color",
|
232 |
+
input_border_color_hover_dark="*input_border_color",
|
233 |
+
input_border_width="1px",
|
234 |
+
input_border_width_dark="1px",
|
235 |
+
input_padding="*spacing_xl",
|
236 |
+
input_placeholder_color="*neutral_500",
|
237 |
+
input_placeholder_color_dark="*neutral_500",
|
238 |
+
input_radius="*radius_lg",
|
239 |
+
input_shadow="none",
|
240 |
+
input_shadow_dark="none",
|
241 |
+
input_shadow_focus="*input_shadow",
|
242 |
+
input_shadow_focus_dark="*input_shadow",
|
243 |
+
input_text_size="*text_md",
|
244 |
+
input_text_weight="400",
|
245 |
+
layout_gap="*spacing_xxl",
|
246 |
+
link_text_color="*secondary_500",
|
247 |
+
link_text_color_active="*secondary_500",
|
248 |
+
link_text_color_active_dark="*secondary_500",
|
249 |
+
link_text_color_dark="*secondary_500",
|
250 |
+
link_text_color_hover="*secondary_400",
|
251 |
+
link_text_color_hover_dark="*secondary_400",
|
252 |
+
link_text_color_visited="*secondary_600",
|
253 |
+
link_text_color_visited_dark="*secondary_600",
|
254 |
+
loader_color="*color_accent",
|
255 |
+
loader_color_dark="*color_accent",
|
256 |
+
panel_background_fill="*background_fill_secondary",
|
257 |
+
panel_background_fill_dark="*background_fill_secondary",
|
258 |
+
panel_border_color="*border_color_primary",
|
259 |
+
panel_border_color_dark="*border_color_primary",
|
260 |
+
panel_border_width="1px",
|
261 |
+
panel_border_width_dark="1px",
|
262 |
+
prose_header_text_weight="600",
|
263 |
+
prose_text_size="*text_md",
|
264 |
+
prose_text_weight="400",
|
265 |
+
radio_circle="url(\"data:image/svg+xml,%3csvg viewBox='0 0 16 16' fill='white' xmlns='http://www.w3.org/2000/svg'%3e%3ccircle cx='8' cy='8' r='3'/%3e%3c/svg%3e\")",
|
266 |
+
section_header_text_size="*text_md",
|
267 |
+
section_header_text_weight="400",
|
268 |
+
shadow_drop="rgba(0,0,0,0.05) 0px 1px 2px 0px",
|
269 |
+
shadow_drop_lg="0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1)",
|
270 |
+
shadow_inset="rgba(0,0,0,0.05) 0px 2px 4px 0px inset",
|
271 |
+
shadow_spread="3px",
|
272 |
+
shadow_spread_dark="1px",
|
273 |
+
slider_color="#9E9E9E",
|
274 |
+
slider_color_dark="#9E9E9E",
|
275 |
+
stat_background_fill="*primary_500",
|
276 |
+
stat_background_fill_dark="*primary_500",
|
277 |
+
table_border_color="*neutral_700",
|
278 |
+
table_border_color_dark="*neutral_700",
|
279 |
+
table_even_background_fill="*neutral_950",
|
280 |
+
table_even_background_fill_dark="*neutral_950",
|
281 |
+
table_odd_background_fill="*neutral_900",
|
282 |
+
table_odd_background_fill_dark="*neutral_900",
|
283 |
+
table_radius="*radius_lg",
|
284 |
+
table_row_focus="*color_accent_soft",
|
285 |
+
table_row_focus_dark="*color_accent_soft",
|
286 |
+
)
|
287 |
+
|
288 |
+
|
289 |
+
applio = Applio()
|
290 |
+
|