6
6
7
7
@import './variables.css' ;
8
8
9
- /* Document oriented look for the notebook (scrollbar to the right of the page) */
9
+ /**
10
+ Document oriented look for the notebook.
11
+ This includes changes to the look and feel of the JupyterLab Notebook
12
+ component like:
13
+ - scrollbar to the right of the page
14
+ - drop shadow on the notebook
15
+ - smaller empty space at the bottom of the notebook
16
+ - compact view on mobile
17
+ */
18
+
19
+ /* Keep the notebook centered on the page */
10
20
11
21
body [data-notebook = 'notebooks' ] .jp-NotebookPanel-toolbar {
12
22
padding-left : calc (calc (100% - var (--jp-notebook-max-width )) * 0.5 );
13
23
padding-right : calc (calc (100% - var (--jp-notebook-max-width )) * 0.5 );
14
24
}
15
25
16
- body [data-notebook = 'notebooks' ] .jp-Notebook > * {
17
- background : var (--jp-layout-color0 );
18
- }
19
-
20
- body [data-notebook = 'notebooks' ]
21
- .jp-Notebook .jp-mod-commandMode
22
- .jp-Cell .jp-mod-active .jp-mod-selected : not (.jp-mod-multiSelected ) {
23
- background : var (--jp-layout-color0 ) !important ;
24
- }
25
-
26
- body [data-notebook = 'notebooks' ] .jp-WindowedPanel-inner {
27
- margin-top : var (--jp-notebook-toolbar-margin-bottom );
28
- }
29
-
30
- body [data-notebook = 'notebooks' ] .jp-Notebook > * : first-child : not (: last-child ) {
31
- box-shadow : 0px 0px 12px 1px var (--jp-shadow-umbra-color );
32
- }
33
-
34
26
body [data-notebook = 'notebooks' ] .jp-Notebook {
35
27
padding-top : unset;
36
- padding-bottom : unset;
37
28
padding-left : calc (calc (100% - var (--jp-notebook-max-width )) * 0.5 );
38
29
padding-right : calc (
39
30
calc (
@@ -43,12 +34,37 @@ body[data-notebook='notebooks'] .jp-Notebook {
43
34
background : var (--jp-layout-color2 );
44
35
}
45
36
37
+ body [data-notebook = 'notebooks' ] .jp-WindowedPanel-inner {
38
+ margin-top : var (--jp-notebook-toolbar-margin-bottom );
39
+ }
40
+
41
+ body [data-notebook = 'notebooks' ] .jp-Notebook-cell {
42
+ background : var (--jp-layout-color0 );
43
+ padding-left : calc (2 * var (--jp-cell-padding ));
44
+ padding-right : calc (2 * var (--jp-cell-padding ));
45
+ }
46
+
47
+ /* Empty space at the bottom of the notebook (similar to classic) */
46
48
body [data-notebook = 'notebooks' ] .jp-Notebook .jp-mod-scrollPastEnd ::after {
47
49
min-height : 100px ;
48
50
}
49
51
50
- /* body[data-notebook='notebooks'] .jp-WindowedPanel-window > *:first-child { */
51
- /* TODO: revisit when https://github.com/jupyterlab/jupyterlab/issues/13151 is fixed */
52
+ /* Fix background colors */
53
+
54
+ body [data-notebook = 'notebooks' ] .jp-Notebook > * {
55
+ background : var (--jp-layout-color0 );
56
+ }
57
+
58
+ body [data-notebook = 'notebooks' ]
59
+ .jp-Notebook .jp-mod-commandMode
60
+ .jp-Cell .jp-mod-active .jp-mod-selected : not (.jp-mod-multiSelected ) {
61
+ background : var (--jp-layout-color0 ) !important ;
62
+ }
63
+
64
+ /**
65
+ Extra padding to the first and and last cell of the notebook.
66
+ TODO: revisit when https://github.com/jupyterlab/jupyterlab/issues/13151 is fixed
67
+ */
52
68
.jp-Notebook-cell [data-windowed-list-index = '0' ] {
53
69
padding-top : calc (2 * var (--jp-notebook-padding ));
54
70
}
@@ -106,7 +122,65 @@ body[data-notebook='notebooks']
106
122
}
107
123
}
108
124
109
- /* ---- */
125
+ /* Mobile View */
126
+
127
+ body [data-format = 'mobile' ] .jp-NotebookCheckpoint {
128
+ display : none;
129
+ }
130
+
131
+ body [data-format = 'mobile' ] .jp-Notebook > * : first-child {
132
+ margin-top : 0 ;
133
+ }
134
+
135
+ /* Virtual Notebook fixes */
136
+
137
+ body [data-notebook = 'notebooks' ] .jp-WindowedPanel-window {
138
+ background : var (--jp-layout-color0 );
139
+ /* TODO: remove when https://github.com/jupyterlab/jupyterlab/pull/13154 is released */
140
+ width : unset;
141
+ }
142
+
143
+ body [data-notebook = 'notebooks' ] .jp-WindowedPanel-inner {
144
+ /* TODO: remove when https://github.com/jupyterlab/jupyterlab/pull/13157 is released */
145
+ width : unset;
146
+ }
147
+
148
+ /* Notebook box shadow */
149
+
150
+ body [data-notebook = 'notebooks' ] .jp-Notebook > * : first-child : not (: last-child ) {
151
+ box-shadow : 0px 0px 12px 1px var (--jp-shadow-umbra-color );
152
+ }
153
+
154
+ body [data-notebook = 'notebooks' ] .jp-Notebook > * : first-child : not (: last-child ) {
155
+ box-shadow : 0px 0px 12px 1px var (--jp-shadow-umbra-color );
156
+ }
157
+
158
+ body [data-notebook = 'notebooks' ]
159
+ .jp-Notebook
160
+ > * : first-child : last-child ::before {
161
+ content : '' ;
162
+ position : absolute;
163
+ top : 0 ;
164
+ bottom : 0 ;
165
+ left : 0 ;
166
+ right : 0 ;
167
+ box-shadow : 0px 0px 12px 1px var (--jp-shadow-umbra-color );
168
+ }
169
+
170
+ body [data-notebook = 'notebooks' ]
171
+ .jp-Notebook
172
+ .jp-Notebook-cell : not (: first- child)::after ,
173
+ body [data-notebook = 'notebooks' ]
174
+ .jp-Notebook
175
+ .jp-Notebook-cell : not (: first-child )::before {
176
+ content : ' ' ;
177
+ height : 100% ;
178
+ position : absolute;
179
+ top : 0 ;
180
+ width : 11px ;
181
+ }
182
+
183
+ /* Additional customizations of the components on the notebook page */
110
184
111
185
.jp-NotebookKernelLogo {
112
186
flex : 0 0 auto;
@@ -187,63 +261,3 @@ body[data-notebook='notebooks']
187
261
overflow : hidden;
188
262
white-space : nowrap;
189
263
}
190
-
191
- /* Mobile View */
192
-
193
- body [data-format = 'mobile' ] .jp-NotebookCheckpoint {
194
- display : none;
195
- }
196
-
197
- body [data-format = 'mobile' ] .jp-Notebook > * : first-child {
198
- margin-top : 0 ;
199
- }
200
-
201
- /* Virtual Notebook fixes */
202
-
203
- body [data-notebook = 'notebooks' ] .jp-WindowedPanel-window {
204
- background : var (--jp-layout-color0 );
205
- /* TODO: remove when https://github.com/jupyterlab/jupyterlab/pull/13154 is released */
206
- width : unset;
207
- }
208
-
209
- body [data-notebook = 'notebooks' ] .jp-WindowedPanel-inner {
210
- /* TODO: remove when https://github.com/jupyterlab/jupyterlab/pull/13157 is released */
211
- width : unset;
212
- }
213
-
214
- body [data-notebook = 'notebooks' ] .jp-Notebook-cell {
215
- background : var (--jp-layout-color0 );
216
- padding-left : calc (2 * var (--jp-cell-padding ));
217
- padding-right : calc (2 * var (--jp-cell-padding ));
218
- }
219
-
220
- /* Notebook box shadow */
221
-
222
- body [data-notebook = 'notebooks' ] .jp-Notebook > * : first-child : not (: last-child ) {
223
- box-shadow : 0px 0px 12px 1px var (--jp-shadow-umbra-color );
224
- }
225
-
226
- body [data-notebook = 'notebooks' ]
227
- .jp-Notebook
228
- > * : first-child : last-child ::before {
229
- content : '' ;
230
- position : absolute;
231
- top : 0 ;
232
- bottom : 0 ;
233
- left : 0 ;
234
- right : 0 ;
235
- box-shadow : 0px 0px 12px 1px var (--jp-shadow-umbra-color );
236
- }
237
-
238
- body [data-notebook = 'notebooks' ]
239
- .jp-Notebook
240
- .jp-Notebook-cell : not (: first- child)::after ,
241
- body [data-notebook = 'notebooks' ]
242
- .jp-Notebook
243
- .jp-Notebook-cell : not (: first-child )::before {
244
- content : ' ' ;
245
- height : 100% ;
246
- position : absolute;
247
- top : 0 ;
248
- width : 11px ;
249
- }
0 commit comments