Add body color to gr.Accordion (#8284)

* add color to body

* add changeset

* add accordion_text_color var

* change default to body_text_color

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
This commit is contained in:
Hannah 2024-05-21 23:52:38 +01:00 committed by GitHub
parent fe91e10269
commit 2d705bcf74
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 19 additions and 0 deletions

View File

@ -0,0 +1,6 @@
---
"@gradio/accordion": patch
"gradio": patch
---
fix:Add body color to `gr.Accordion`

View File

@ -586,6 +586,8 @@ class Base(ThemeClass):
section_header_text_size=None,
section_header_text_weight=None,
# Component Atoms: These set the style for elements within components.
accordion_text_color=None,
accordion_text_color_dark=None,
checkbox_background_color=None,
checkbox_background_color_dark=None,
checkbox_background_color_focus=None,
@ -822,6 +824,8 @@ class Base(ThemeClass):
panel_border_color_dark: The border color of a panel in dark mode.
panel_border_width: The border width of a panel.
panel_border_width_dark: The border width of a panel in dark mode.
accordion_text_color: The body text color in the accordion.
accordion_text_color_dark: The body text color in the accordion in dark mode.
section_header_text_size: The text size of a section header (e.g. tab name).
section_header_text_weight: The text weight of a section header (e.g. tab name).
checkbox_background_color: The background of a checkbox square or radio circle.
@ -1051,6 +1055,12 @@ class Base(ThemeClass):
self.body_text_color_subdued_dark = body_text_color_subdued_dark or getattr(
self, "body_text_color_subdued_dark", "*neutral_400"
)
self.accordion_text_color = accordion_text_color or getattr(
self, "accordion_text_color", "*body_text_color"
)
self.accordion_text_color_dark = accordion_text_color_dark or getattr(
self, "accordion_text_color_dark", "*body_text_color"
)
# Shadows
self.shadow_drop = shadow_drop or getattr(
self, "shadow_drop", "rgba(0,0,0,0.05) 0px 1px 2px 0px"

View File

@ -44,6 +44,8 @@ class Monochrome(Base):
# Colors
slider_color="*neutral_900",
slider_color_dark="*neutral_500",
accordion_text_color="*body_text_color*",
accordion_text_color_dark="*body_text_color_dark*",
body_text_color="*neutral_900",
block_label_text_color="*body_text_color",
block_title_text_color="*body_text_color",

View File

@ -23,6 +23,7 @@
justify-content: space-between;
cursor: pointer;
width: var(--size-full);
color: var(--accordion-text-color);
}
.label-wrap.open {
margin-bottom: var(--size-2);