Spaces:
Running
Running
delete theme/carbon.py
Browse files- theme/carbon.py +0 -147
theme/carbon.py
DELETED
@@ -1,147 +0,0 @@
|
|
1 |
-
"""IBM Carbon theme for gradio demos.
|
2 |
-
|
3 |
-
This version builds on top of the Carbon theme to make it more playful with rounded corners, a larger font family to
|
4 |
-
enhance readability, and the IBM Cool Gray color palette for better consistency with other IBM Research demos, such as
|
5 |
-
Bee.
|
6 |
-
"""
|
7 |
-
|
8 |
-
import gradio as gr
|
9 |
-
from gradio.themes.utils import sizes
|
10 |
-
|
11 |
-
theme = gr.themes.Base(
|
12 |
-
primary_hue=gr.themes.Color(
|
13 |
-
c100="#EDF5FF",
|
14 |
-
c200="#D0E2FF",
|
15 |
-
c300="#A6C8FF",
|
16 |
-
c400="#78A9FF",
|
17 |
-
c50="#F9F9FB",
|
18 |
-
c500="#4589FF",
|
19 |
-
c600="#0F62FE",
|
20 |
-
c700="#0043CE",
|
21 |
-
c800="#002D9C",
|
22 |
-
c900="#001D6C",
|
23 |
-
c950="#001141",
|
24 |
-
),
|
25 |
-
secondary_hue=gr.themes.Color(
|
26 |
-
c100="#EDF5FF",
|
27 |
-
c200="#D0E2FF",
|
28 |
-
c300="#A6C8FF",
|
29 |
-
c400="#78A9FF",
|
30 |
-
c50="#F9F9FB",
|
31 |
-
c500="#4589FF",
|
32 |
-
c600="#0F62FE",
|
33 |
-
c700="#0043CE",
|
34 |
-
c800="#002D9C",
|
35 |
-
c900="#001D6C",
|
36 |
-
c950="#001141",
|
37 |
-
),
|
38 |
-
neutral_hue=gr.themes.Color(
|
39 |
-
c100="#F2F4F8",
|
40 |
-
c200="#DDE1E6",
|
41 |
-
c300="#C1C7CD",
|
42 |
-
c400="#A2A9B0",
|
43 |
-
c50="#F9F9FB",
|
44 |
-
c500="#878D96",
|
45 |
-
c600="#697077",
|
46 |
-
c700="#4D5358",
|
47 |
-
c800="#393939",
|
48 |
-
c900="#21272A",
|
49 |
-
c950="#121619",
|
50 |
-
),
|
51 |
-
spacing_size=sizes.spacing_md, # change spacing to default size
|
52 |
-
radius_size=sizes.radius_md, # change spacing to default size and Keep Radius to make demo feel more playful
|
53 |
-
text_size=sizes.text_lg, # change fontsize to default size
|
54 |
-
# spacing_size: sizes.Size | str = sizes.spacing_md, #change spacing to default size
|
55 |
-
# radius_size: sizes.Size | str = sizes.radius_md, #change spacing to default size and Keep Radius to make
|
56 |
-
# demo feel more playful
|
57 |
-
# text_size: sizes.Size | str = sizes.text_lg, #change fontsize to default size
|
58 |
-
font=["IBM Plex Sans", "ui-sans-serif", "system-ui", "sans-serif"], # update font
|
59 |
-
font_mono=["IBM Plex Mono", "ui-monospace", "Consolas", "monospace"], # update font
|
60 |
-
).set(
|
61 |
-
# Colors
|
62 |
-
background_fill_primary="*neutral_100", # Coolgray10 background
|
63 |
-
background_fill_primary_dark="*neutral_950", # Coolgray95 background for dark mode
|
64 |
-
slider_color="*primary_600", # Blue60
|
65 |
-
slider_color_dark="*primary_500", # Blue50
|
66 |
-
# Shadows
|
67 |
-
shadow_drop="0 1px 4px 0 rgb(0 0 0 / 0.1)",
|
68 |
-
shadow_drop_lg="0 2px 5px 0 rgb(0 0 0 / 0.1)",
|
69 |
-
# Block Labels
|
70 |
-
block_background_fill="white",
|
71 |
-
block_label_background_fill="white", # same color as blockback gound fill
|
72 |
-
block_label_radius="*radius_md",
|
73 |
-
block_label_text_size="*text_md",
|
74 |
-
block_label_text_weight="600",
|
75 |
-
block_label_text_color="black",
|
76 |
-
block_label_text_color_dark="white",
|
77 |
-
block_title_radius="*block_label_radius",
|
78 |
-
block_title_background_fill="*block_label_background_fill",
|
79 |
-
block_title_text_weight="600",
|
80 |
-
block_title_text_color="black",
|
81 |
-
block_title_text_color_dark="white",
|
82 |
-
block_label_margin="*spacing_md",
|
83 |
-
# Inputs
|
84 |
-
input_background_fill="white",
|
85 |
-
input_background_fill_dark="*block-background-fill",
|
86 |
-
input_border_color="*neutral_100",
|
87 |
-
input_shadow="*shadow_drop",
|
88 |
-
input_shadow_focus="*shadow_drop_lg",
|
89 |
-
checkbox_shadow="none",
|
90 |
-
# Buttons
|
91 |
-
shadow_spread="6px",
|
92 |
-
button_primary_shadow="*shadow_drop_lg",
|
93 |
-
button_primary_shadow_hover="*shadow_drop_lg",
|
94 |
-
button_primary_shadow_active="*shadow_inset",
|
95 |
-
button_secondary_shadow="*shadow_drop_lg",
|
96 |
-
button_secondary_shadow_hover="*shadow_drop_lg",
|
97 |
-
button_secondary_shadow_active="*shadow_inset",
|
98 |
-
checkbox_label_shadow="*shadow_drop_lg",
|
99 |
-
button_primary_background_fill="*primary_600",
|
100 |
-
button_primary_background_fill_hover="*primary_500",
|
101 |
-
button_primary_background_fill_hover_dark="*primary_500",
|
102 |
-
button_primary_text_color="white",
|
103 |
-
button_secondary_background_fill="white",
|
104 |
-
button_secondary_background_fill_hover="*neutral_100",
|
105 |
-
button_secondary_background_fill_dark="*neutral_800", # Secondary cool gray 80
|
106 |
-
button_secondary_background_fill_hover_dark="*primary_500",
|
107 |
-
button_secondary_text_color="*neutral_800",
|
108 |
-
button_cancel_background_fill="*button_secondary_background_fill",
|
109 |
-
button_cancel_background_fill_hover="*button_secondary_background_fill_hover",
|
110 |
-
button_cancel_background_fill_hover_dark="*button_secondary_background_fill_hover",
|
111 |
-
button_cancel_text_color="*button_secondary_text_color",
|
112 |
-
checkbox_label_background_fill_selected="*primary_200",
|
113 |
-
checkbox_label_background_fill_selected_dark="*primary_500",
|
114 |
-
checkbox_border_width="1px",
|
115 |
-
checkbox_border_color="*neutral_200",
|
116 |
-
checkbox_background_color_dark="*neutral_700", # Jan 18 test to fix checkbox, radio button background color
|
117 |
-
checkbox_background_color_selected="*primary_600",
|
118 |
-
checkbox_background_color_selected_dark="*primary_500",
|
119 |
-
checkbox_border_color_focus="*primary_600",
|
120 |
-
checkbox_border_color_focus_dark="*primary_500",
|
121 |
-
checkbox_border_color_selected="*primary_600",
|
122 |
-
checkbox_border_color_selected_dark="*primary_500",
|
123 |
-
checkbox_label_text_color_selected="black",
|
124 |
-
# Borders
|
125 |
-
block_border_width="1px", # test example border
|
126 |
-
panel_border_width="1px",
|
127 |
-
# Chatbubble related colors
|
128 |
-
# light
|
129 |
-
# color_accent = "*secondary_400",
|
130 |
-
border_color_accent_subdued="*color_accent_soft", # chatbubble human border color, use Blue 20 as an accent color
|
131 |
-
color_accent_soft="*secondary_200", # chatbubble human color
|
132 |
-
# darkmode
|
133 |
-
# chatbubble human border color in darkmode, use Blue 20 as an accent color
|
134 |
-
border_color_accent_subdued_dark="*secondary_500",
|
135 |
-
color_accent_soft_dark="*secondary_500", # chatbubble human color in dark mode
|
136 |
-
# Chatbot related font
|
137 |
-
chatbot_text_size="*text_md", # make it larger
|
138 |
-
# additional dark mode related tweaks:
|
139 |
-
# block_background_fill_dark="*neutral_950", # Jan 18 test coolgray95 background for dark mode
|
140 |
-
block_label_background_fill_dark="*neutral_800", # same color as blockback gound fill
|
141 |
-
block_title_background_fill_dark="*block_label_background_fill",
|
142 |
-
# input_background_fill_dark="*neutral_800", #This attribute help match fill color cool gray 80 to match background
|
143 |
-
# however cause the problem for the general theme.
|
144 |
-
# input_shadow_dark="*shadow_drop", #Test if it could make the border without the color
|
145 |
-
# input_border_color_dark="*neutral_200",#add attribute for border Jan 18
|
146 |
-
checkbox_border_color_dark="*neutral_600", # Jan 18 test to fix border
|
147 |
-
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|