From c2e13845882b420001961feff0d4dbcb124558e6 Mon Sep 17 00:00:00 2001 From: Stephan Hoyer Date: Sun, 28 Sep 2025 13:15:45 -0700 Subject: [PATCH 1/2] Less vertical whitespace in HTML reprs --- xarray/static/css/style.css | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/xarray/static/css/style.css b/xarray/static/css/style.css index 78f7c35d9cb..0a48514dec3 100644 --- a/xarray/static/css/style.css +++ b/xarray/static/css/style.css @@ -121,6 +121,8 @@ body.vscode-dark { padding-left: 0 !important; display: grid; grid-template-columns: 150px auto auto 1fr 0 20px 0 20px; + margin-block-start: 0; + margin-block-end: 0; } .xr-section-item { @@ -131,6 +133,7 @@ body.vscode-dark { display: inline-block; opacity: 0; height: 0; + margin: 0; } .xr-section-item input + label { @@ -189,7 +192,6 @@ body.vscode-dark { .xr-section-summary, .xr-section-inline-details { padding-top: 4px; - padding-bottom: 4px; } .xr-section-inline-details { @@ -199,6 +201,7 @@ body.vscode-dark { .xr-section-details { display: none; grid-column: 1 / -1; + margin-top: 4px; margin-bottom: 5px; } From b3bb3861f803ab6c8a0c2266bf786a8bbe19cea4 Mon Sep 17 00:00:00 2001 From: Stephan Hoyer Date: Sun, 28 Sep 2025 13:34:09 -0700 Subject: [PATCH 2/2] ensure consistent line-height in google colab --- xarray/static/css/style.css | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/xarray/static/css/style.css b/xarray/static/css/style.css index 0a48514dec3..8b8e854b62a 100644 --- a/xarray/static/css/style.css +++ b/xarray/static/css/style.css @@ -1,6 +1,4 @@ -/* CSS stylesheet for displaying xarray objects in jupyterlab. - * - */ +/* CSS stylesheet for displaying xarray objects in notebooks */ :root { --xr-font-color0: var( @@ -79,6 +77,7 @@ body.vscode-dark { display: block !important; min-width: 300px; max-width: 700px; + line-height: 1.6; } .xr-text-repr-fallback {