Skip to content

Commit

Permalink
Add --table-text-color var to fix body text in Examples (#8364)
Browse files Browse the repository at this point in the history
* add --table-text-color var

* add changeset

* format

* tweak

* add changeset

* fix

* add changeset

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
  • Loading branch information
hannahblair and gradio-pr-bot authored May 23, 2024
1 parent 94a1143 commit 6a1b58c
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 2 deletions.
6 changes: 6 additions & 0 deletions .changeset/huge-melons-dream.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"@gradio/dataset": patch
"gradio": patch
---

fix:Add `--table-text-color` var to fix body text in `Examples`
10 changes: 10 additions & 0 deletions gradio/themes/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -588,6 +588,8 @@ def set(
# Component Atoms: These set the style for elements within components.
accordion_text_color=None,
accordion_text_color_dark=None,
table_text_color=None,
table_text_color_dark=None,
checkbox_background_color=None,
checkbox_background_color_dark=None,
checkbox_background_color_focus=None,
Expand Down Expand Up @@ -826,6 +828,8 @@ def set(
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.
table_text_color: The body text color in the table.
table_text_color_dark: The body text color in the table 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.
Expand Down Expand Up @@ -1061,6 +1065,12 @@ def set(
self.accordion_text_color_dark = accordion_text_color_dark or getattr(
self, "accordion_text_color_dark", "*body_text_color"
)
self.table_text_color = table_text_color or getattr(
self, "table_text_color", "*body_text_color"
)
self.table_text_color_dark = table_text_color_dark or getattr(
self, "table_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"
Expand Down
6 changes: 4 additions & 2 deletions gradio/themes/monochrome.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,10 @@ def __init__(
# Colors
slider_color="*neutral_900",
slider_color_dark="*neutral_500",
accordion_text_color="*body_text_color*",
accordion_text_color_dark="*body_text_color_dark*",
accordion_text_color="*body_text_color",
accordion_text_color_dark="*body_text_color",
table_text_color="*body_text_color",
table_text_color_dark="*body_text_color",
body_text_color="*neutral_900",
block_label_text_color="*body_text_color",
block_title_text_color="*body_text_color",
Expand Down
1 change: 1 addition & 0 deletions js/dataset/Index.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -279,6 +279,7 @@
table-layout: auto;
overflow-x: auto;
line-height: var(--line-sm);
color: var(--table-text-color);
}
table {
width: var(--size-full);
Expand Down

0 comments on commit 6a1b58c

Please sign in to comment.