File size: 5,585 Bytes
df56fc1
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
import gradio as gr

primary_palette = gr.themes.Color(
        c50="#282253",
        c100="#282253",
        c200="#282253",
        c300="#282253",
        c400="#282253",
        c500="#282253",
        c600="white",
        c700="#EC5F9C",
        c800="#EC4D92",
        c900="#EB3A86",
        c950='#E9277A',
    )

css_variables = {
    'body_text_color_dark': '*neutral_800',
     'color_accent_soft_dark': '*primary_50',
     'background_fill_primary_dark': 'white',
     'background_fill_secondary_dark': '*neutral_50',
     'border_color_accent_dark': '*primary_300',
     'border_color_primary_dark': '*neutral_200',
     'link_text_color_dark': '*secondary_600',
     'link_text_color_active_dark': '*secondary_600',
     'link_text_color_hover_dark': '*secondary_700',
     'link_text_color_visited_dark': '*secondary_500',
     'body_text_color_subdued_dark': '*neutral_400',
     'shadow_spread_dark': '3px',
     'block_background_fill_dark': '*background_fill_primary',
     'block_border_color_dark': '*border_color_primary',
     'block_border_width_dark': '1px',
     'block_info_text_color_dark': '*body_text_color_subdued',
     'block_label_background_fill_dark': '*background_fill_primary',
     'block_label_border_color_dark': '*border_color_primary',
     'block_label_border_width_dark': '1px',
     'block_label_text_color_dark': '*neutral_500',
     'block_title_text_color_dark': '*neutral_500',
     'panel_background_fill_dark': '*background_fill_secondary',
     'panel_border_color_dark': '*border_color_primary',
     'panel_border_width_dark': '0',
     'checkbox_background_color_dark': '*background_fill_primary',
     'checkbox_background_color_focus_dark': '*checkbox_background_color',
     'checkbox_background_color_hover_dark': '*checkbox_background_color',
     'checkbox_background_color_selected_dark': '*secondary_600',
     'checkbox_border_color_dark': '*neutral_300',
     'checkbox_border_color_focus_dark': '*secondary_500',
     'checkbox_border_color_hover_dark': '*neutral_300',
     'checkbox_border_color_selected_dark': '*secondary_600',
     'checkbox_label_background_fill_dark': 'linear-gradient(to top, *neutral_50, white)',
     'checkbox_label_background_fill_hover_dark': 'linear-gradient(to top, *neutral_100, white)',
     'checkbox_label_background_fill_selected_dark': '*checkbox_label_background_fill',
     'checkbox_label_border_color_dark': '*border_color_primary',
     'checkbox_label_border_color_hover_dark': '*checkbox_label_border_color',
     'checkbox_label_border_width_dark': '*input_border_width',
     'checkbox_label_text_color_dark': '*body_text_color',
     'checkbox_label_text_color_selected_dark': '*checkbox_label_text_color',
     'error_background_fill_dark': 'linear-gradient(to right, #fee2e2, *background_fill_secondary)',
     'error_border_color_dark': '#fecaca',
     'error_border_width_dark': '1px',
     'error_text_color_dark': '#ef4444',
     'input_background_fill_dark': 'white',
     'input_background_fill_focus_dark': '*secondary_500',
     'input_background_fill_hover_dark': '*input_background_fill',
     'input_border_color_dark': '*border_color_primary',
     'input_border_color_focus_dark': '*secondary_300',
     'input_border_color_hover_dark': '*input_border_color',
     'input_border_width_dark': '1px',
     'input_placeholder_color_dark': '*neutral_400',
     'input_shadow_dark': '0 0 0 *shadow_spread transparent, *shadow_inset',
     'input_shadow_focus_dark': '0 0 0 *shadow_spread *secondary_50, *shadow_inset',
     'loader_color_dark': '*color_accent',
     'slider_color_dark': '',
     'stat_background_fill_dark': 'linear-gradient(to right, *primary_400, *primary_200)',
     'table_border_color_dark': '*neutral_300',
     'table_even_background_fill_dark': 'white',
     'table_odd_background_fill_dark': '*neutral_50',
     'table_row_focus_dark': '*color_accent_soft',
     'button_border_width_dark': '*input_border_width',
     'button_cancel_background_fill_dark': 'linear-gradient(to bottom right, #fee2e2, #fecaca)',
     'button_cancel_background_fill_hover_dark': 'linear-gradient(to bottom right, #fee2e2, #fee2e2)',
     'button_cancel_border_color_dark': '#fecaca',
     'button_cancel_border_color_hover_dark': '*button_cancel_border_color',
     'button_cancel_text_color_dark': '#dc2626',
     'button_cancel_text_color_hover_dark': '*button_cancel_text_color',
     'button_primary_background_fill_dark': 'linear-gradient(to bottom right, *primary_100, *primary_300)',
     'button_primary_background_fill_hover_dark': 'linear-gradient(to bottom right, *primary_100, *primary_200)',
     'button_primary_border_color_dark': '*primary_200',
     'button_primary_border_color_hover_dark': '*button_primary_border_color',
     'button_primary_text_color_dark': '*primary_600',
     'button_primary_text_color_hover_dark': '*button_primary_text_color',
     'button_secondary_background_fill_dark': 'linear-gradient(to bottom right, *neutral_100, *neutral_200)',
     'button_secondary_background_fill_hover_dark': 'linear-gradient(to bottom right, *neutral_100, *neutral_100)',
     'button_secondary_border_color_dark': '*neutral_200',
     'button_secondary_border_color_hover_dark': '*button_secondary_border_color',
     'button_secondary_text_color_dark': '*neutral_700',
     'button_secondary_text_color_hover_dark': '*button_secondary_text_color'
}

theme=gr.themes.Default(primary_hue=primary_palette)
theme.set(
        body_background_fill='#F8F9FA',
        body_background_fill_dark='#F8F9FA',
        **css_variables)