Skip to content

Commit 43d07b7

Browse files
jsignellmax-sixty
authored andcommitted
jupyterlab dark theme (#3443)
1 parent c955449 commit 43d07b7

File tree

1 file changed

+25
-18
lines changed

1 file changed

+25
-18
lines changed

xarray/static/css/style.css

Lines changed: 25 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,17 @@
22
*
33
*/
44

5+
:root {
6+
--xr-font-color0: var(--jp-content-font-color0, rgba(0, 0, 0, 1));
7+
--xr-font-color2: var(--jp-content-font-color2, rgba(0, 0, 0, 0.54));
8+
--xr-font-color3: var(--jp-content-font-color3, rgba(0, 0, 0, 0.38));
9+
--xr-border-color: var(--jp-border-color2, #e0e0e0);
10+
--xr-disabled-color: var(--jp-layout-color3, #bdbdbd);
11+
--xr-background-color: var(--jp-layout-color0, white);
12+
--xr-background-color-row-even: var(--jp-layout-color1, white);
13+
--xr-background-color-row-odd: var(--jp-layout-color2, #eeeeee);
14+
}
15+
516
.xr-wrap {
617
min-width: 300px;
718
max-width: 700px;
@@ -11,7 +22,7 @@
1122
padding-top: 6px;
1223
padding-bottom: 6px;
1324
margin-bottom: 4px;
14-
border-bottom: solid 1px #ddd;
25+
border-bottom: solid 1px var(--xr-border-color);
1526
}
1627

1728
.xr-header > div,
@@ -28,11 +39,7 @@
2839
}
2940

3041
.xr-obj-type {
31-
color: #555;
32-
}
33-
34-
.xr-array-name {
35-
color: #000;
42+
color: var(--xr-font-color2);
3643
}
3744

3845
.xr-sections {
@@ -50,21 +57,21 @@
5057
}
5158

5259
.xr-section-item input + label {
53-
color: #ccc;
60+
color: var(--xr-disabled-color);
5461
}
5562

5663
.xr-section-item input:enabled + label {
5764
cursor: pointer;
58-
color: #555;
65+
color: var(--xr-font-color2);
5966
}
6067

6168
.xr-section-item input:enabled + label:hover {
62-
color: #000;
69+
color: var(--xr-font-color0);
6370
}
6471

6572
.xr-section-summary {
6673
grid-column: 1;
67-
color: #555;
74+
color: var(--xr-font-color2);
6875
font-weight: 500;
6976
}
7077

@@ -74,7 +81,7 @@
7481
}
7582

7683
.xr-section-summary-in:disabled + label {
77-
color: #555;
84+
color: var(--xr-font-color2);
7885
}
7986

8087
.xr-section-summary-in + label:before {
@@ -86,7 +93,7 @@
8693
}
8794

8895
.xr-section-summary-in:disabled + label:before {
89-
color: #ccc;
96+
color: var(--xr-disabled-color);
9097
}
9198

9299
.xr-section-summary-in:checked + label:before {
@@ -129,7 +136,7 @@
129136
}
130137

131138
.xr-preview {
132-
color: #888;
139+
color: var(--xr-font-color3);
133140
}
134141

135142
.xr-array-preview,
@@ -186,7 +193,7 @@
186193
.xr-var-item > div,
187194
.xr-var-item label,
188195
.xr-var-item > .xr-var-name span {
189-
background-color: #fcfcfc;
196+
background-color: var(--xr-background-color-row-even);
190197
margin-bottom: 0;
191198
}
192199

@@ -197,7 +204,7 @@
197204
.xr-var-list > li:nth-child(odd) > div,
198205
.xr-var-list > li:nth-child(odd) > label,
199206
.xr-var-list > li:nth-child(odd) > .xr-var-name span {
200-
background-color: #efefef;
207+
background-color: var(--xr-background-color-row-odd);
201208
}
202209

203210
.xr-var-name {
@@ -211,7 +218,7 @@
211218
.xr-var-dtype {
212219
grid-column: 3;
213220
text-align: right;
214-
color: #555;
221+
color: var(--xr-font-color2);
215222
}
216223

217224
.xr-var-preview {
@@ -241,7 +248,7 @@
241248
.xr-var-attrs,
242249
.xr-var-data {
243250
display: none;
244-
background-color: #fff !important;
251+
background-color: var(--xr-background-color) !important;
245252
padding-bottom: 5px !important;
246253
}
247254

@@ -288,7 +295,7 @@ dl.xr-attrs {
288295

289296
.xr-attrs dt:hover span {
290297
display: inline-block;
291-
background: #fff;
298+
background: var(--xr-background-color);
292299
padding-right: 10px;
293300
}
294301

0 commit comments

Comments
 (0)