From 2f200644d0d592d7d23a7a19ac5e7bbedd1b839b Mon Sep 17 00:00:00 2001 From: Roger Shieh Date: Fri, 5 Feb 2021 11:56:01 +0800 Subject: [PATCH 1/2] adaptive theme --- ipyplot/_html_helpers.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ipyplot/_html_helpers.py b/ipyplot/_html_helpers.py index 6841134..29e0e41 100644 --- a/ipyplot/_html_helpers.py +++ b/ipyplot/_html_helpers.py @@ -419,12 +419,12 @@ def _get_default_style(img_width: int, zoom_scale: float): div.ipyplot-content-div-%(0)s { width: %(1)spx; - background: white; + background: var(--jp-layout-color0); display: inline-block; vertical-align: top; text-align: center; position: relative; - border: 2px solid #ddd; + border: var(--jp-border-width) solid var(--jp-cell-editor-border-color); top: 0; left: 0; } From 46e3c228916a8215885cb24a116e00b1f892f80b Mon Sep 17 00:00:00 2001 From: Roger Shieh Date: Sat, 6 Feb 2021 11:34:49 +0800 Subject: [PATCH 2/2] add fallback style --- ipyplot/_html_helpers.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ipyplot/_html_helpers.py b/ipyplot/_html_helpers.py index 29e0e41..d6a5281 100644 --- a/ipyplot/_html_helpers.py +++ b/ipyplot/_html_helpers.py @@ -419,12 +419,12 @@ def _get_default_style(img_width: int, zoom_scale: float): div.ipyplot-content-div-%(0)s { width: %(1)spx; - background: var(--jp-layout-color0); + background: var(--jp-layout-color0, white); display: inline-block; vertical-align: top; text-align: center; position: relative; - border: var(--jp-border-width) solid var(--jp-cell-editor-border-color); + border: var(--jp-border-width, 2px) solid var(--jp-cell-editor-border-color, #ddd); top: 0; left: 0; }