Updating theme
Browse files- README.md +11 -6
- app.py +139 -0
- themes/[email protected] +1 -0
README.md
CHANGED
@@ -1,12 +1,17 @@
|
|
|
|
1 |
---
|
2 |
-
|
3 |
-
|
4 |
-
colorFrom:
|
5 |
-
colorTo:
|
6 |
sdk: gradio
|
7 |
sdk_version: 4.43.0
|
8 |
app_file: app.py
|
9 |
pinned: false
|
|
|
10 |
---
|
11 |
-
|
12 |
-
|
|
|
|
|
|
|
|
1 |
+
|
2 |
---
|
3 |
+
tags: [gradio-theme]
|
4 |
+
title: amethyst
|
5 |
+
colorFrom: red
|
6 |
+
colorTo: purple
|
7 |
sdk: gradio
|
8 |
sdk_version: 4.43.0
|
9 |
app_file: app.py
|
10 |
pinned: false
|
11 |
+
license: apache-2.0
|
12 |
---
|
13 |
+
# amethyst
|
14 |
+
## Description
|
15 |
+
Add a description of this theme here!
|
16 |
+
## Contributions
|
17 |
+
Thanks to [@hmb](https://huggingface.co/hmb) for adding this gradio theme!
|
app.py
ADDED
@@ -0,0 +1,139 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import time
|
2 |
+
|
3 |
+
import gradio as gr
|
4 |
+
from gradio.themes.utils.theme_dropdown import create_theme_dropdown
|
5 |
+
|
6 |
+
dropdown, js = create_theme_dropdown()
|
7 |
+
|
8 |
+
with gr.Blocks(theme='hmb/amethyst') as demo:
|
9 |
+
with gr.Row(equal_height=True):
|
10 |
+
with gr.Column(scale=10):
|
11 |
+
gr.Markdown(
|
12 |
+
"""
|
13 |
+
# Theme preview: `amethyst`
|
14 |
+
To use this theme, set `theme='hmb/amethyst'` in `gr.Blocks()` or `gr.Interface()`.
|
15 |
+
You can append an `@` and a semantic version expression, e.g. @>=1.0.0,<2.0.0 to pin to a given version
|
16 |
+
of this theme.
|
17 |
+
"""
|
18 |
+
)
|
19 |
+
with gr.Column(scale=3):
|
20 |
+
with gr.Group():
|
21 |
+
dropdown.render()
|
22 |
+
toggle_dark = gr.Button(value="Toggle Dark")
|
23 |
+
|
24 |
+
dropdown.change(None, dropdown, None, js=js)
|
25 |
+
toggle_dark.click(
|
26 |
+
None,
|
27 |
+
js="""
|
28 |
+
() => {
|
29 |
+
document.body.classList.toggle('dark');
|
30 |
+
}
|
31 |
+
""",
|
32 |
+
)
|
33 |
+
|
34 |
+
name = gr.Textbox(
|
35 |
+
label="Name",
|
36 |
+
info="Full name, including middle name. No special characters.",
|
37 |
+
placeholder="John Doe",
|
38 |
+
value="John Doe",
|
39 |
+
interactive=True,
|
40 |
+
)
|
41 |
+
|
42 |
+
with gr.Row():
|
43 |
+
slider1 = gr.Slider(label="Slider 1")
|
44 |
+
slider2 = gr.Slider(label="Slider 2")
|
45 |
+
gr.CheckboxGroup(["A", "B", "C"], label="Checkbox Group")
|
46 |
+
|
47 |
+
with gr.Row():
|
48 |
+
with gr.Column(variant="panel", scale=1):
|
49 |
+
gr.Markdown("## Panel 1")
|
50 |
+
radio = gr.Radio(
|
51 |
+
["A", "B", "C"],
|
52 |
+
label="Radio",
|
53 |
+
info="Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.",
|
54 |
+
)
|
55 |
+
drop = gr.Dropdown(["Option 1", "Option 2", "Option 3"], show_label=False)
|
56 |
+
drop_2 = gr.Dropdown(
|
57 |
+
["Option A", "Option B", "Option C"],
|
58 |
+
multiselect=True,
|
59 |
+
value=["Option A"],
|
60 |
+
label="Dropdown",
|
61 |
+
interactive=True,
|
62 |
+
)
|
63 |
+
check = gr.Checkbox(label="Go")
|
64 |
+
with gr.Column(variant="panel", scale=2):
|
65 |
+
img = gr.Image(
|
66 |
+
"https://gradio-static-files.s3.us-west-2.amazonaws.com/header-image.jpg",
|
67 |
+
label="Image",
|
68 |
+
height=320,
|
69 |
+
)
|
70 |
+
with gr.Row():
|
71 |
+
go_btn = gr.Button("Go", variant="primary")
|
72 |
+
clear_btn = gr.Button("Clear", variant="secondary")
|
73 |
+
|
74 |
+
def go(*_args):
|
75 |
+
time.sleep(3)
|
76 |
+
return "https://gradio-static-files.s3.us-west-2.amazonaws.com/header-image.jpg"
|
77 |
+
|
78 |
+
go_btn.click(go, [radio, drop, drop_2, check, name], img, api_name="go")
|
79 |
+
|
80 |
+
def clear():
|
81 |
+
time.sleep(0.2)
|
82 |
+
|
83 |
+
clear_btn.click(clear, None, img)
|
84 |
+
|
85 |
+
with gr.Row():
|
86 |
+
btn1 = gr.Button("Button 1", size="sm")
|
87 |
+
btn2 = gr.UploadButton(size="sm")
|
88 |
+
stop_btn = gr.Button("Stop", size="sm", variant="stop")
|
89 |
+
|
90 |
+
with gr.Row():
|
91 |
+
gr.Dataframe(value=[[1, 2, 3], [4, 5, 6], [7, 8, 9]], label="Dataframe")
|
92 |
+
gr.JSON(
|
93 |
+
value={"a": 1, "b": 2, "c": {"test": "a", "test2": [1, 2, 3]}}, label="JSON"
|
94 |
+
)
|
95 |
+
gr.Label(value={"cat": 0.7, "dog": 0.2, "fish": 0.1})
|
96 |
+
gr.File()
|
97 |
+
with gr.Row():
|
98 |
+
gr.ColorPicker()
|
99 |
+
gr.Video("https://gradio-static-files.s3.us-west-2.amazonaws.com/world.mp4")
|
100 |
+
gr.Gallery(
|
101 |
+
[
|
102 |
+
(
|
103 |
+
"https://gradio-static-files.s3.us-west-2.amazonaws.com/lion.jpg",
|
104 |
+
"lion",
|
105 |
+
),
|
106 |
+
(
|
107 |
+
"https://gradio-static-files.s3.us-west-2.amazonaws.com/logo.png",
|
108 |
+
"logo",
|
109 |
+
),
|
110 |
+
(
|
111 |
+
"https://gradio-static-files.s3.us-west-2.amazonaws.com/tower.jpg",
|
112 |
+
"tower",
|
113 |
+
),
|
114 |
+
],
|
115 |
+
height=200,
|
116 |
+
)
|
117 |
+
|
118 |
+
with gr.Row():
|
119 |
+
with gr.Column(scale=2):
|
120 |
+
chatbot = gr.Chatbot([("Hello", "Hi")], label="Chatbot")
|
121 |
+
chat_btn = gr.Button("Add messages")
|
122 |
+
|
123 |
+
chat_btn.click(
|
124 |
+
lambda history: history
|
125 |
+
+ [["How are you?", "I am good."]]
|
126 |
+
+ (time.sleep(2) or []),
|
127 |
+
chatbot,
|
128 |
+
chatbot,
|
129 |
+
)
|
130 |
+
with gr.Column(scale=1):
|
131 |
+
with gr.Accordion("Advanced Settings"):
|
132 |
+
gr.Markdown("Hello")
|
133 |
+
gr.Number(label="Chatbot control 1")
|
134 |
+
gr.Number(label="Chatbot control 2")
|
135 |
+
gr.Number(label="Chatbot control 3")
|
136 |
+
|
137 |
+
|
138 |
+
if __name__ == "__main__":
|
139 |
+
demo.queue().launch()
|
themes/[email protected]
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
{"theme": {"_font": [{"__gradio_font__": true, "name": "Outfit", "class": "google"}, {"__gradio_font__": true, "name": "ui-sans-serif", "class": "font"}, {"__gradio_font__": true, "name": "system-ui", "class": "font"}, {"__gradio_font__": true, "name": "sans-serif", "class": "font"}], "_font_mono": [{"__gradio_font__": true, "name": "Fira Code", "class": "google"}, {"__gradio_font__": true, "name": "ui-monospace", "class": "font"}, {"__gradio_font__": true, "name": "Consolas", "class": "font"}, {"__gradio_font__": true, "name": "monospace", "class": "font"}], "_stylesheets": ["https://fonts.googleapis.com/css2?family=Outfit:wght@400;600&display=swap", "https://fonts.googleapis.com/css2?family=Fira+Code:wght@400;600&display=swap"], "accordion_text_color": "*body_text_color", "accordion_text_color_dark": "*body_text_color", "background_fill_primary": "#2A2A3C", "background_fill_primary_dark": "#1E1E2E", "background_fill_secondary": "#3A3A4F", "background_fill_secondary_dark": "#2A2A3C", "block_background_fill": "#2A2A3C", "block_background_fill_dark": "#1E1E2E", "block_border_color": "#4B4B63", "block_border_color_dark": "#3A3A4F", "block_border_width": "1px", "block_info_text_color": "*body_text_color_subdued", "block_info_text_color_dark": "*body_text_color_subdued", "block_info_text_size": "*text_sm", "block_info_text_weight": "400", "block_label_background_fill": "rgba(157, 102, 252, 0.1)", "block_label_background_fill_dark": "*background_fill_secondary", "block_label_border_color": "*border_color_primary", "block_label_border_color_dark": "*border_color_primary", "block_label_border_width": "0px", "block_label_margin": "0", "block_label_padding": "*spacing_sm *spacing_lg", "block_label_radius": "calc(*radius_lg - 1px) 0 calc(*radius_lg - 1px) 0", "block_label_right_radius": "0 calc(*radius_lg - 1px) 0 calc(*radius_lg - 1px)", "block_label_shadow": "*block_shadow", "block_label_text_color": "#CBB8F3", "block_label_text_color_dark": "#D4C2F9", "block_label_text_size": "*text_sm", "block_label_text_weight": "400", "block_padding": "*spacing_xl calc(*spacing_xl + 2px)", "block_radius": "*radius_lg", "block_shadow": "none", "block_title_background_fill": "none", "block_title_border_color": "none", "block_title_border_width": "0px", "block_title_padding": "0", "block_title_radius": "none", "block_title_text_color": "#F1EFF8", "block_title_text_color_dark": "#F8F7FC", "block_title_text_size": "*text_md", "block_title_text_weight": "400", "body_background_fill": "linear-gradient(135deg, #1E1E2E 0%, #2D2B3A 100%)", "body_background_fill_dark": "linear-gradient(135deg, #13131F 0%, #1E1E2E 100%)", "body_text_color": "#E2E0EA", "body_text_color_dark": "#F1EFF8", "body_text_color_subdued": "*neutral_400", "body_text_color_subdued_dark": "*neutral_400", "body_text_size": "*text_md", "body_text_weight": "400", "border_color_accent": "#B794F5", "border_color_accent_dark": "*neutral_600", "border_color_accent_subdued": "*border_color_accent", "border_color_accent_subdued_dark": "*border_color_accent", "border_color_primary": "#4B4B63", "border_color_primary_dark": "#3A3A4F", "button_border_width": "*input_border_width", "button_border_width_dark": "*input_border_width", "button_cancel_background_fill": "*button_secondary_background_fill", "button_cancel_background_fill_dark": "*button_secondary_background_fill", "button_cancel_background_fill_hover": "*button_cancel_background_fill", "button_cancel_background_fill_hover_dark": "*button_cancel_background_fill", "button_cancel_border_color": "*button_secondary_border_color", "button_cancel_border_color_dark": "*button_secondary_border_color", "button_cancel_border_color_hover": "*button_cancel_border_color", "button_cancel_border_color_hover_dark": "*button_cancel_border_color", "button_cancel_text_color": "*button_secondary_text_color", "button_cancel_text_color_dark": "*button_secondary_text_color", "button_cancel_text_color_hover": "*button_cancel_text_color", "button_cancel_text_color_hover_dark": "*button_cancel_text_color", "button_large_padding": "*spacing_lg calc(2 * *spacing_lg)", "button_large_radius": "*radius_lg", "button_large_text_size": "*text_lg", "button_large_text_weight": "600", "button_primary_background_fill": "#9D66FC", "button_primary_background_fill_dark": "*primary_700", "button_primary_background_fill_hover": "#8B4FFA", "button_primary_background_fill_hover_dark": "*button_primary_background_fill", "button_primary_border_color": "#9D66FC", "button_primary_border_color_dark": "*primary_600", "button_primary_border_color_hover": "*button_primary_border_color", "button_primary_border_color_hover_dark": "*button_primary_border_color", "button_primary_text_color": "#FFFFFF", "button_primary_text_color_dark": "white", "button_primary_text_color_hover": "*button_primary_text_color", "button_primary_text_color_hover_dark": "*button_primary_text_color", "button_secondary_background_fill": "#3A3A4F", "button_secondary_background_fill_dark": "*neutral_600", "button_secondary_background_fill_hover": "#4B4B63", "button_secondary_background_fill_hover_dark": "*button_secondary_background_fill", "button_secondary_border_color": "#4B4B63", "button_secondary_border_color_dark": "*neutral_600", "button_secondary_border_color_hover": "*button_secondary_border_color", "button_secondary_border_color_hover_dark": "*button_secondary_border_color", "button_secondary_text_color": "#E2E0EA", "button_secondary_text_color_dark": "white", "button_secondary_text_color_hover": "*button_secondary_text_color", "button_secondary_text_color_hover_dark": "*button_secondary_text_color", "button_shadow": "none", "button_shadow_active": "none", "button_shadow_hover": "none", "button_small_padding": "*spacing_sm calc(2 * *spacing_sm)", "button_small_radius": "*radius_lg", "button_small_text_size": "*text_md", "button_small_text_weight": "400", "button_transition": "background-color 0.2s ease", "checkbox_background_color": "#3A3A4F", "checkbox_background_color_dark": "#2A2A3C", "checkbox_background_color_focus": "*checkbox_background_color", "checkbox_background_color_focus_dark": "*checkbox_background_color", "checkbox_background_color_hover": "*checkbox_background_color", "checkbox_background_color_hover_dark": "*checkbox_background_color", "checkbox_background_color_selected": "*secondary_600", "checkbox_background_color_selected_dark": "*secondary_600", "checkbox_border_color": "#4B4B63", "checkbox_border_color_dark": "#3A3A4F", "checkbox_border_color_focus": "*secondary_500", "checkbox_border_color_focus_dark": "*secondary_500", "checkbox_border_color_hover": "*neutral_300", "checkbox_border_color_hover_dark": "*neutral_600", "checkbox_border_color_selected": "*secondary_600", "checkbox_border_color_selected_dark": "*secondary_600", "checkbox_border_radius": "*radius_sm", "checkbox_border_width": "1px", "checkbox_border_width_dark": "1px", "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\")", "checkbox_label_background_fill": "*button_secondary_background_fill", "checkbox_label_background_fill_dark": "*button_secondary_background_fill", "checkbox_label_background_fill_hover": "*button_secondary_background_fill_hover", "checkbox_label_background_fill_hover_dark": "*button_secondary_background_fill_hover", "checkbox_label_background_fill_selected": "*checkbox_label_background_fill", "checkbox_label_background_fill_selected_dark": "*checkbox_label_background_fill", "checkbox_label_border_color": "*border_color_primary", "checkbox_label_border_color_dark": "*border_color_primary", "checkbox_label_border_color_hover": "*checkbox_label_border_color", "checkbox_label_border_color_hover_dark": "*checkbox_label_border_color", "checkbox_label_border_width": "*input_border_width", "checkbox_label_border_width_dark": "*input_border_width", "checkbox_label_gap": "*spacing_lg", "checkbox_label_padding": "*spacing_md calc(2 * *spacing_md)", "checkbox_label_shadow": "none", "checkbox_label_text_color": "*body_text_color", "checkbox_label_text_color_dark": "*body_text_color", "checkbox_label_text_color_selected": "*checkbox_label_text_color", "checkbox_label_text_color_selected_dark": "*checkbox_label_text_color", "checkbox_label_text_size": "*text_md", "checkbox_label_text_weight": "400", "checkbox_shadow": "*input_shadow", "code_background_fill": "*neutral_100", "code_background_fill_dark": "*neutral_800", "color_accent": "#9D66FC", "color_accent_soft": "rgba(157, 102, 252, 0.2)", "color_accent_soft_dark": "rgba(157, 102, 252, 0.3)", "container_radius": "*radius_lg", "embed_radius": "*radius_lg", "error_background_fill": "#fef2f2", "error_background_fill_dark": "*background_fill_primary", "error_border_color": "#b91c1c", "error_border_color_dark": "#ef4444", "error_border_width": "1px", "error_icon_color": "#b91c1c", "error_icon_color_dark": "#ef4444", "error_text_color": "#b91c1c", "error_text_color_dark": "#fef2f2", "font": "'Outfit', 'ui-sans-serif', 'system-ui', sans-serif", "font_mono": "'Fira Code', 'ui-monospace', 'Consolas', monospace", "form_gap_width": "0px", "input_background_fill": "#3A3A4F", "input_background_fill_dark": "#2A2A3C", "input_background_fill_focus": "*secondary_500", "input_background_fill_focus_dark": "*secondary_600", "input_background_fill_hover": "*input_background_fill", "input_background_fill_hover_dark": "*input_background_fill", "input_border_color": "#4B4B63", "input_border_color_dark": "#3A3A4F", "input_border_color_focus": "*secondary_300", "input_border_color_focus_dark": "*neutral_700", "input_border_color_hover": "*input_border_color", "input_border_color_hover_dark": "*input_border_color", "input_border_width": "1px", "input_padding": "*spacing_xl", "input_placeholder_color": "*neutral_400", "input_placeholder_color_dark": "*neutral_500", "input_radius": "*radius_lg", "input_shadow": "none", "input_shadow_focus": "*input_shadow", "input_text_size": "*text_md", "input_text_weight": "400", "layout_gap": "*spacing_xxl", "link_text_color": "*secondary_600", "link_text_color_active": "*secondary_600", "link_text_color_active_dark": "*secondary_500", "link_text_color_dark": "*secondary_500", "link_text_color_hover": "*secondary_700", "link_text_color_hover_dark": "*secondary_400", "link_text_color_visited": "*secondary_500", "link_text_color_visited_dark": "*secondary_600", "loader_color": "*color_accent", "name": "base", "neutral_100": "#f1f5f9", "neutral_200": "#e2e8f0", "neutral_300": "#cbd5e1", "neutral_400": "#94a3b8", "neutral_50": "#f8fafc", "neutral_500": "#64748b", "neutral_600": "#475569", "neutral_700": "#334155", "neutral_800": "#1e293b", "neutral_900": "#0f172a", "neutral_950": "#0a0f1e", "panel_background_fill": "*background_fill_secondary", "panel_background_fill_dark": "*background_fill_secondary", "panel_border_color": "*border_color_primary", "panel_border_color_dark": "*border_color_primary", "panel_border_width": "0", "primary_100": "#f1f5f9", "primary_200": "#e2e8f0", "primary_300": "#cbd5e1", "primary_400": "#94a3b8", "primary_50": "#f8fafc", "primary_500": "#64748b", "primary_600": "#475569", "primary_700": "#334155", "primary_800": "#1e293b", "primary_900": "#0f172a", "primary_950": "#0a0f1e", "prose_header_text_weight": "600", "prose_text_size": "*text_md", "prose_text_weight": "400", "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\")", "radius_lg": "8px", "radius_md": "6px", "radius_sm": "4px", "radius_xl": "12px", "radius_xs": "2px", "radius_xxl": "22px", "radius_xxs": "1px", "secondary_100": "#f3e8ff", "secondary_200": "#e9d5ff", "secondary_300": "#d8b4fe", "secondary_400": "#c084fc", "secondary_50": "#faf5ff", "secondary_500": "#a855f7", "secondary_600": "#9333ea", "secondary_700": "#7e22ce", "secondary_800": "#6b21a8", "secondary_900": "#581c87", "secondary_950": "#4c1a73", "section_header_text_size": "*text_md", "section_header_text_weight": "400", "shadow_drop": "0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1)", "shadow_drop_lg": "0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1)", "shadow_inset": "inset 0 2px 4px 0 rgba(0, 0, 0, 0.05)", "shadow_spread": "3px", "shadow_spread_dark": "1px", "slider_color": "#9D66FC", "spacing_lg": "8px", "spacing_md": "6px", "spacing_sm": "4px", "spacing_xl": "10px", "spacing_xs": "2px", "spacing_xxl": "16px", "spacing_xxs": "1px", "stat_background_fill": "*primary_300", "stat_background_fill_dark": "*primary_500", "table_border_color": "*neutral_300", "table_border_color_dark": "*neutral_700", "table_even_background_fill": "white", "table_even_background_fill_dark": "*neutral_950", "table_odd_background_fill": "*neutral_50", "table_odd_background_fill_dark": "*neutral_900", "table_radius": "*radius_lg", "table_row_focus": "*color_accent_soft", "table_row_focus_dark": "*color_accent_soft", "table_text_color": "*body_text_color", "table_text_color_dark": "*body_text_color", "text_lg": "16px", "text_md": "14px", "text_sm": "12px", "text_xl": "22px", "text_xs": "10px", "text_xxl": "26px", "text_xxs": "9px"}, "version": "0.0.1"}
|