File size: 4,449 Bytes
2d527a9
 
 
 
 
 
 
16b7a8d
2d527a9
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
fa90224
672958f
3afc20b
 
 
b7cd21c
c970812
0431428
 
7a4881d
5baadc9
 
2d527a9
f270e85
2d527a9
9b2809c
7a4881d
 
2d527a9
 
 
 
 
 
 
 
 
 
5baadc9
 
7a4881d
 
2d527a9
 
 
 
 
4d49d01
 
2d527a9
 
 
 
 
 
 
16b7a8d
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
from __future__ import annotations

from typing import Iterable

from gradio.themes.base import Base
from gradio.themes.utils import colors, fonts, sizes


class Theme(Base):
    def __init__(
        self,
        *,
        primary_hue: colors.Color | str = colors.lime,
        secondary_hue: colors.Color | str = colors.emerald,
        neutral_hue: colors.Color | str = colors.stone,
        spacing_size: sizes.Size | str = sizes.spacing_lg,
        radius_size: sizes.Size | str = sizes.radius_none,
        text_size: sizes.Size | str = sizes.text_md,
        font: fonts.Font | str | Iterable[fonts.Font | str] = (
            fonts.GoogleFont("Quicksand"),
            "ui-sans-serif",
            "system-ui",
            "sans-serif",
        ),
        font_mono: fonts.Font | str | Iterable[fonts.Font | str] = (
            fonts.GoogleFont("IBM Plex Mono"),
            "ui-monospace",
            "Consolas",
            "monospace",
        ),
    ):
        super().__init__(
            primary_hue=primary_hue,
            secondary_hue=secondary_hue,
            neutral_hue=neutral_hue,
            spacing_size=spacing_size,
            radius_size=radius_size,
            text_size=text_size,
            font=font,
            font_mono=font_mono,
        )
        self.name = "theme"
        super().set(
            # Colors
            slider_color="#66814a",  # Tonos pasteles de verde para los colores de los sliders
            body_text_color="#66814a",  # Verde oscuro para el color del texto del cuerpo
            block_label_text_color="#66814a",  # Verde oscuro para el color del texto de las etiquetas de bloque
            block_title_text_color="#66814a",  # Verde oscuro para el color del texto de los tΓ­tulos de bloque
            body_text_color_subdued="#66814a",  # Tonos pasteles de verde para el texto del cuerpo sutil
            body_background_fill="#92b96a",  # Fondo del cuerpo en tonos pasteles de verde
            background_fill_primary="#c8dcb4",  # Fondo primario en tonos pasteles de verde
            background_fill_primary_dark="#89BD88",  # Fondo primario oscuro en tonos pasteles de verde
            background_fill_secondary_dark="#89BD88",  # Fondo secundario oscuro en tonos pasteles de verde
            block_background_fill="#d3e3c3",  # Fondo de bloque en tonos pasteles de verde
            block_background_fill_dark="#d3e3c3",  # Fondo oscuro de bloque en tonos pasteles de verde
            input_background_fill_dark="#d3e3c3",  # Fondo de entrada oscura en tonos pasteles de verde
            # Button Colors
            button_primary_background_fill="#66814a",
            button_primary_background_fill_hover='*primary_200',
            button_primary_text_color="white",
            button_primary_background_fill_dark="green",
            button_primary_background_fill_hover_dark="green",
            button_primary_text_color_dark="white",
            button_secondary_background_fill="*button_primary_background_fill",
            button_secondary_background_fill_hover="*button_primary_background_fill_hover",
            button_secondary_text_color="*button_primary_text_color",
            button_cancel_background_fill="*button_primary_background_fill",
            button_cancel_background_fill_hover="*button_primary_background_fill_hover",
            button_cancel_text_color="*button_primary_text_color",
            checkbox_label_background_fill="*button_primary_background_fill",
            checkbox_label_background_fill_hover="*button_primary_background_fill_hover",
            checkbox_label_text_color="*button_primary_text_color",
            checkbox_background_color_selected="*green",
            checkbox_background_color_dark="*green",
            checkbox_background_color_selected_dark="green",
            checkbox_border_color_selected_dark="*green",
            # Padding
            checkbox_label_padding="*spacing_md",
            button_large_padding="*spacing_lg",
            button_small_padding="*spacing_sm",
            # Borders
            block_border_width="0px",
            block_border_width_dark="1px",
            shadow_drop_lg="0 1px 4px 0 rgb(0 0 0 / 0.1)",
            block_shadow="*shadow_drop_lg",
            block_shadow_dark="none",
            # Block Labels
            block_title_text_weight="600",
            block_label_text_weight="600",
            block_label_text_size="*text_md",
        )