Skip to content

Commit 16ee717

Browse files
CSS: workaround ipywidgets dark mode issues (#15)
* css: workaround ipywidgets dark mode issues * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * more tweaks and fixes * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * typo * bring some margin again * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
1 parent c046e51 commit 16ee717

File tree

1 file changed

+29
-2
lines changed

1 file changed

+29
-2
lines changed

docs/_static/style.css

Lines changed: 29 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,36 @@
11
.xr-wrap {
2+
/* workaround when (ipy)widgets are present in output cells
3+
* https://github.com/xarray-contrib/xarray-indexes/issues/14
4+
* only rely on pydata-sphinx-theme variables here!
5+
*/
6+
--xr-font-color0: var(--pst-color-text-base);
7+
--xr-font-color2: var(--pst-color-text-base);
8+
--xr-font-color3: var(--pst-color-text-base);
9+
--xr-border-color: hsl(from var(--pst-color-text-base) h s calc(l + 40));
10+
--xr-disabled-color: hsl(from var(--pst-color-text-base) h s calc(l + 40));
11+
--xr-background-color: var(--pst-color-on-background);
12+
--xr-background-color-row-even: hsl(
13+
from var(--pst-color-on-background) h s calc(l - 5)
14+
);
15+
--xr-background-color-row-odd: hsl(
16+
from var(--pst-color-on-background) h s calc(l - 15)
17+
);
18+
219
font-size: 0.85em;
320
margin-left: 1.25em;
4-
padding-left: 1.25em;
5-
border-left: thin var(--color-foreground-muted) solid;
621
}
22+
23+
html[data-theme="dark"] .xr-wrap {
24+
--xr-border-color: hsl(from var(--pst-color-text-base) h s calc(l - 40));
25+
--xr-disabled-color: hsl(from var(--pst-color-text-base) h s calc(l - 40));
26+
--xr-background-color-row-even: hsl(
27+
from var(--pst-color-on-background) h s calc(l + 5)
28+
);
29+
--xr-background-color-row-odd: hsl(
30+
from var(--pst-color-on-background) h s calc(l + 15)
31+
);
32+
}
33+
734
.xr-array-wrap,
835
.xr-var-data,
936
.xr-var-preview {

0 commit comments

Comments
 (0)