Spaces:
Running
Running
File size: 2,070 Bytes
a328dd2 |
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 |
import gradio as gr
from gradio.themes.base import Base
from gradio.themes.utils import colors, fonts, sizes
class TufteInspired(Base):
def __init__(
self,
*,
primary_hue: colors.Color | str = colors.stone,
secondary_hue: colors.Color | str = colors.gray,
neutral_hue: colors.Color | str = colors.gray,
spacing_size: sizes.Size | str = sizes.spacing_md,
radius_size: sizes.Size | str = sizes.radius_sm,
text_size: sizes.Size | str = sizes.text_lg,
font: list[fonts.Font | str] = [
fonts.GoogleFont("EB Garamond"),
"Georgia",
"serif"
],
font_mono: list[fonts.Font | str] = [
fonts.GoogleFont("IBM Plex Mono"),
"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.set(
body_background_fill="#fffff8",
body_background_fill_dark="#151515",
body_text_color="*neutral_950",
body_text_color_dark="*neutral_50",
background_fill_primary="#fffff8",
background_fill_primary_dark="#151515",
block_title_text_weight="400",
block_border_width="0px",
block_shadow="none",
button_primary_background_fill="*primary_100",
button_primary_background_fill_hover="*primary_200",
button_primary_text_color="*neutral_950",
button_primary_border_color="*primary_300",
button_shadow="none",
input_background_fill="*secondary_50",
input_background_fill_dark="*secondary_900",
input_border_color="*secondary_200",
input_border_color_dark="*secondary_700",
input_shadow="none",
)
|