Spaces:
Sleeping
Sleeping
| from __future__ import annotations | |
| from collections.abc import Iterable | |
| from gradio.themes.base import Base | |
| from gradio.themes.utils import colors, fonts, sizes | |
| # ββ Parchment palette βββββββββββββββββββββββββββββββββββββββββββββββββββββββββ | |
| parchment = colors.Color( | |
| name="parchment", | |
| c50="#FFFDF9", | |
| c100="#F7F0E6", | |
| c200="#F0E8D8", | |
| c300="#E8DCC8", | |
| c400="#D4C3A8", | |
| c500="#C4B49A", | |
| c600="#A89070", | |
| c700="#8A7660", | |
| c800="#F0E8D8", | |
| c900="#F7F0E6", | |
| c950="#3D2E1E", | |
| ) | |
| brown = colors.Color( | |
| name="brown", | |
| c50="#FDF6EE", | |
| c100="#F5EDD9", | |
| c200="#EAD9B8", | |
| c300="#D4B88A", | |
| c400="#C49A60", | |
| c500="#A87840", | |
| c600="#8A5C2E", | |
| c700="#5C3A1E", | |
| c800="#3D2614", | |
| c900="#2A1A0E", | |
| c950="#1A0F08", | |
| ) | |
| class Philatelist(Base): | |
| def __init__( | |
| self, | |
| *, | |
| primary_hue: colors.Color | str = brown, | |
| secondary_hue: colors.Color | str = parchment, | |
| neutral_hue: colors.Color | str = parchment, | |
| spacing_size: sizes.Size | str = sizes.spacing_md, | |
| radius_size: sizes.Size | str = sizes.radius_md, | |
| text_size: sizes.Size | str = sizes.text_sm, | |
| font: fonts.Font | str | Iterable[fonts.Font | str] = ( | |
| fonts.GoogleFont("Space Mono"), | |
| "ui-monospace", | |
| "monospace", | |
| ), | |
| font_mono: fonts.Font | str | Iterable[fonts.Font | str] = ( | |
| fonts.GoogleFont("Space Mono"), | |
| "ui-monospace", | |
| "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 = "philatelist" | |
| super().set( | |
| # ββ Canvas ββ | |
| body_background_fill="*neutral_100", | |
| body_text_color="#3D2E1E", | |
| background_fill_primary="*neutral_100", | |
| background_fill_secondary="*neutral_200", | |
| # ββ Blocks ββ | |
| block_background_fill="*neutral_100", | |
| block_border_color="*neutral_400", | |
| block_border_width="0px", | |
| block_shadow="none", | |
| block_label_background_fill="*neutral_100", | |
| block_label_text_color="#3D2E1E", | |
| block_label_text_color_dark="#3D2E1E", | |
| block_title_text_color="#3D2E1E", | |
| block_title_text_color_dark="#3D2E1E", | |
| body_text_color_subdued="#3D2E1E", | |
| body_text_color_subdued_dark="#3D2E1E", | |
| # ββ Inputs ββ | |
| input_background_fill="white", | |
| input_background_fill_focus="white", | |
| input_border_color="*neutral_400", | |
| input_border_color_focus="*primary_700", | |
| input_border_width="1.5px", | |
| input_shadow="none", | |
| input_shadow_focus="2px 2px 0px *primary_700", | |
| input_placeholder_color="*neutral_600", | |
| # ββ Borders ββ | |
| border_color_primary="*neutral_400", | |
| border_color_accent="*primary_700", | |
| # ββ Buttons β primary ββ | |
| button_primary_background_fill="*primary_700", | |
| button_primary_background_fill_hover="*primary_600", | |
| button_primary_text_color="#E8C97A", | |
| button_primary_border_color="*primary_700", | |
| button_primary_shadow="3px 3px 0px *neutral_600", | |
| button_primary_shadow_hover="4px 4px 0px *neutral_600", | |
| button_primary_shadow_active="1px 1px 0px *neutral_600", | |
| button_transform_hover="translate(-1px, -1px)", | |
| button_transform_active="translate(2px, 2px)", | |
| button_transition="transform .12s, box-shadow .12s", | |
| button_border_width="0px", | |
| # ββ Buttons β secondary ββ | |
| button_secondary_background_fill="white", | |
| button_secondary_background_fill_hover="*neutral_100", | |
| button_secondary_text_color="*neutral_950", | |
| button_secondary_border_color="*neutral_400", | |
| button_secondary_shadow="none", | |
| # ββ Accent ββ | |
| color_accent="*primary_700", | |
| color_accent_soft="*primary_100", | |
| link_text_color="*primary_700", | |
| link_text_color_hover="*primary_600", | |
| # ββ Checkbox / radio ββ | |
| checkbox_label_background_fill="white", | |
| checkbox_label_background_fill_hover="*neutral_200", | |
| checkbox_label_background_fill_selected="*primary_700", | |
| checkbox_label_border_color_selected="*primary_600", | |
| checkbox_label_border_width="1.5px", | |
| checkbox_label_text_color_selected="white", | |
| ) | |