2
0
mirror of https://github.com/gradio-app/gradio.git synced 2025-04-24 13:01:18 +08:00

Fix darkmode toggle on native plots ()

* Fix darkmode

* CHANGELOG

---------

Co-authored-by: Abubakar Abid <abubakar@huggingface.co>
This commit is contained in:
Freddy Boulton 2023-02-07 15:55:31 -05:00 committed by GitHub
parent 921ff1c47a
commit 71f6117f6f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 7 deletions
CHANGELOG.md
ui/packages/plot/src

@ -47,6 +47,7 @@ By [@maxaudron](https://github.com/maxaudron) in [PR 3075](https://github.com/gr
- A share link will automatically be created when running on Sagemaker notebooks so that the front-end is properly displayed by [@abidlabs](https://github.com/abidlabs) in [PR 3137](https://github.com/gradio-app/gradio/pull/3137)
- Fixes a few dropdown component issues; hide checkmark next to options as expected, and keyboard hover is visible by [@dawoodkhan82](https://github.com/dawoodkhan82) in [PR 3145]https://github.com/gradio-app/gradio/pull/3145)
- Fixed bug where example pagination buttons were not visible in dark mode or displayed under the examples table. By [@freddyaboulton](https://github.com/freddyaboulton) in [PR 3144](https://github.com/gradio-app/gradio/pull/3144)
- Fixed bug where the font color of axis labels and titles for native plots did not respond to dark mode preferences. By [@freddyaboulton](https://github.com/freddyaboulton) in [PR 3146](https://github.com/gradio-app/gradio/pull/3146)
## Documentation Changes:
- Added a guide on the 4 kinds of Gradio Interfaces by [@yvrjsharma](https://github.com/yvrjsharma) and [@abidlabs](https://github.com/abidlabs) in [PR 3003](https://github.com/gradio-app/gradio/pull/3003)

@ -1,30 +1,30 @@
import type { Config as VegaConfig } from "vega";
const light = "#e2e8f0";
const dark = "#111827";
const dark = "#e2e8f0";
const light = "#111827";
export function create_config(darkmode: boolean): VegaConfig {
return {
axis: {
labelFont: "sans-serif",
labelColor: dark,
labelColor: darkmode ? dark : light,
titleFont: "sans-serif",
titleColor: dark,
titleColor: darkmode ? dark : light,
tickColor: "#aaa",
gridColor: "#aaa",
titleFontWeight: "normal",
labelFontWeight: "normal"
},
legend: {
labelColor: dark,
labelColor: darkmode ? dark : light,
labelFont: "sans-serif",
titleColor: dark,
titleColor: darkmode ? dark : light,
titleFont: "sans-serif",
titleFontWeight: "normal",
labelFontWeight: "normal"
},
title: {
color: dark,
color: darkmode ? dark : light,
font: "sans-serif",
fontWeight: "normal"
}