Spaces:
Runtime error
Runtime error
Commit
·
37a671b
1
Parent(s):
7432d34
Create theme.py
Browse files
theme.py
ADDED
|
@@ -0,0 +1,108 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
from gradio.themes.base import Base
|
| 2 |
+
from gradio.themes.utils.colors import Color
|
| 3 |
+
from gradio.themes.utils import colors, fonts, sizes
|
| 4 |
+
from typing import Iterable
|
| 5 |
+
|
| 6 |
+
light_grey = Color(
|
| 7 |
+
name="light_grey",
|
| 8 |
+
c50="#e0e0e0",
|
| 9 |
+
c100="#e0e0e0",
|
| 10 |
+
c200="#e0e0e0",
|
| 11 |
+
c300="#e0e0e0",
|
| 12 |
+
c400="#e0e0e0",
|
| 13 |
+
c500="#e0e0e0",
|
| 14 |
+
c600="#e0e0e0",
|
| 15 |
+
c700="#e0e0e0",
|
| 16 |
+
c800="#e0e0e0",
|
| 17 |
+
c900="#e0e0e0",
|
| 18 |
+
c950="#e0e0e0",
|
| 19 |
+
)
|
| 20 |
+
|
| 21 |
+
class Style(Base):
|
| 22 |
+
def __init__(
|
| 23 |
+
self,
|
| 24 |
+
*,
|
| 25 |
+
primary_hue: colors.Color | str = light_grey,
|
| 26 |
+
secondary_hue: colors.Color | str = light_grey,
|
| 27 |
+
neutral_hue: colors.Color | str = light_grey,
|
| 28 |
+
spacing_size: sizes.Size | str = sizes.spacing_md,
|
| 29 |
+
radius_size: sizes.Size | str = sizes.radius_md,
|
| 30 |
+
text_size: sizes.Size | str = sizes.text_md,
|
| 31 |
+
font: fonts.Font
|
| 32 |
+
| str
|
| 33 |
+
| Iterable[fonts.Font | str] = (fonts.GoogleFont("Sora")),
|
| 34 |
+
font_mono: fonts.Font
|
| 35 |
+
| str
|
| 36 |
+
| Iterable[fonts.Font | str] = (fonts.GoogleFont("Sora")),
|
| 37 |
+
):
|
| 38 |
+
super().__init__(
|
| 39 |
+
primary_hue=primary_hue,
|
| 40 |
+
secondary_hue=secondary_hue,
|
| 41 |
+
neutral_hue=neutral_hue,
|
| 42 |
+
spacing_size=spacing_size,
|
| 43 |
+
radius_size=radius_size,
|
| 44 |
+
text_size=text_size,
|
| 45 |
+
font=font,
|
| 46 |
+
font_mono=font_mono,
|
| 47 |
+
)
|
| 48 |
+
super().set(
|
| 49 |
+
background_fill_primary="#050f19", #The color of the background of blocks
|
| 50 |
+
background_fill_primary_dark="#050f19",
|
| 51 |
+
background_fill_secondary="#081527",
|
| 52 |
+
background_fill_secondary_dark="#081527",
|
| 53 |
+
block_background_fill="#050f19", #The color of the background of blocks
|
| 54 |
+
block_background_fill_dark="#050f19",
|
| 55 |
+
|
| 56 |
+
border_color_primary="#050f19", #The border of a block such as dropdown
|
| 57 |
+
border_color_primary_dark="#050f19",
|
| 58 |
+
|
| 59 |
+
link_text_color="#f0ba2d", #The color for links
|
| 60 |
+
link_text_color_dark="#f0ba2d",
|
| 61 |
+
|
| 62 |
+
block_info_text_color="ffffff",
|
| 63 |
+
block_info_text_color_dark="ffffff",
|
| 64 |
+
|
| 65 |
+
block_border_color="#050f19", #The border color around an item (e.g. Accordion)
|
| 66 |
+
block_border_color_dark="#050f19",
|
| 67 |
+
block_shadow="*shadow_drop_lg",
|
| 68 |
+
#form_gap_width="*spacing_md", #The border gap between form elements, (e.g. consecutive textboxes)
|
| 69 |
+
|
| 70 |
+
input_background_fill="#081527", #The background of an input field
|
| 71 |
+
input_background_fill_dark="#081527",
|
| 72 |
+
input_border_color="#050f19",
|
| 73 |
+
input_border_color_dark="#050f19",
|
| 74 |
+
input_border_width="2px",
|
| 75 |
+
|
| 76 |
+
block_label_background_fill="#050f19",
|
| 77 |
+
block_label_background_fill_dark="#050f19",
|
| 78 |
+
block_label_border_color=None,
|
| 79 |
+
block_label_border_color_dark=None,
|
| 80 |
+
block_label_text_color="#050f19",
|
| 81 |
+
block_label_text_color_dark="#050f19",
|
| 82 |
+
|
| 83 |
+
button_primary_background_fill="#ffffff",
|
| 84 |
+
button_primary_border_color="#ffffff",
|
| 85 |
+
button_primary_text_color="#050f19",
|
| 86 |
+
button_shadow="*shadow_drop_lg",
|
| 87 |
+
|
| 88 |
+
block_title_background_fill="#f0ba2d", #The background of the title of a form element (e.g. textbox).
|
| 89 |
+
block_title_background_fill_dark="#f0ba2d",
|
| 90 |
+
block_title_radius="*radius_sm",#The corner radius of the title of a form element (e.g. textbox).
|
| 91 |
+
block_title_text_color="#050f19", #The text color of the title of a form element (e.g. textbox).
|
| 92 |
+
block_title_text_color_dark="#050f19",
|
| 93 |
+
block_title_text_size="*text_lg",
|
| 94 |
+
block_title_border_width="2px", #The border around the title of a form element (e.g. textbox)
|
| 95 |
+
block_title_border_width_dark="2px",
|
| 96 |
+
block_title_border_color="#f0ba2d",
|
| 97 |
+
block_title_border_color_dark="#f0ba2d",
|
| 98 |
+
|
| 99 |
+
body_background_fill="#050f19",
|
| 100 |
+
body_background_fill_dark="#050f19",
|
| 101 |
+
body_text_color="#ffffff", #The default text color.
|
| 102 |
+
body_text_color_dark="#ffffff",
|
| 103 |
+
body_text_color_subdued="#ffffff",
|
| 104 |
+
body_text_color_subdued_dark="#ffffff",
|
| 105 |
+
|
| 106 |
+
slider_color="*secondary_300",
|
| 107 |
+
slider_color_dark="*secondary_600",
|
| 108 |
+
)
|