mirror of
https://github.com/gradio-app/gradio.git
synced 2024-11-27 01:40:20 +08:00
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:
parent
fe91e10269
commit
2d705bcf74
6
.changeset/open-rice-nail.md
Normal file
6
.changeset/open-rice-nail.md
Normal file
@ -0,0 +1,6 @@
|
||||
---
|
||||
"@gradio/accordion": patch
|
||||
"gradio": patch
|
||||
---
|
||||
|
||||
fix:Add body color to `gr.Accordion`
|
@ -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"
|
||||
|
@ -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",
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user