| 1 |
/*----------------------------------------------------------------------------- |
| 2 |
| Copyright (c) Jupyter Development Team. |
| 3 |
| |
| 4 |
| Distributed under the terms of the Modified BSD License. |
| 5 |
|----------------------------------------------------------------------------*/ |
| 6 |
|
| 7 |
@import './variables.css'; |
| 8 |
|
| 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 */ |
| 20 |
|
| 21 |
body[data-notebook='notebooks'] .jp-NotebookPanel-toolbar { |
| 22 |
padding-left: calc(calc(100% - var(--jp-notebook-max-width)) * 0.5); |
| 23 |
padding-right: calc(calc(100% - var(--jp-notebook-max-width)) * 0.5); |
| 24 |
} |
| 25 |
|
| 26 |
body[data-notebook='notebooks'] .jp-Notebook { |
| 27 |
padding-top: unset; |
| 28 |
padding-left: calc(calc(100% - var(--jp-notebook-max-width)) * 0.5); |
| 29 |
padding-right: calc( |
| 30 |
calc( |
| 31 |
100% - var(--jp-notebook-max-width) - var(--jp-notebook-padding-offset) |
| 32 |
) * 0.5 |
| 33 |
); |
| 34 |
background: var(--jp-layout-color2); |
| 35 |
} |
| 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) */ |
| 48 |
body[data-notebook='notebooks'] .jp-Notebook.jp-mod-scrollPastEnd::after { |
| 49 |
min-height: 100px; |
| 50 |
} |
| 51 |
|
| 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 |
*/ |
| 68 |
.jp-Notebook-cell[data-windowed-list-index='0'] { |
| 69 |
padding-top: calc(2 * var(--jp-notebook-padding)); |
| 70 |
} |
| 71 |
|
| 72 |
body[data-notebook='notebooks'] .jp-WindowedPanel-window > *:last-child { |
| 73 |
padding-bottom: calc(2 * var(--jp-notebook-padding)); |
| 74 |
} |
| 75 |
|
| 76 |
body[data-notebook='notebooks'] |
| 77 |
.jp-Notebook |
| 78 |
.jp-Notebook-cell:not(:first-child)::before { |
| 79 |
content: ' '; |
| 80 |
height: 100%; |
| 81 |
position: absolute; |
| 82 |
top: 0; |
| 83 |
width: 11px; |
| 84 |
} |
| 85 |
|
| 86 |
/* Cell toolbar adjustements */ |
| 87 |
|
| 88 |
body[data-notebook='notebooks'] .jp-cell-toolbar { |
| 89 |
background: unset; |
| 90 |
box-shadow: unset; |
| 91 |
} |
| 92 |
|
| 93 |
body[data-notebook='notebooks'] |
| 94 |
.jp-RawCell[data-windowed-list-index='0'] |
| 95 |
.jp-cell-toolbar, |
| 96 |
body[data-notebook='notebooks'] |
| 97 |
.jp-MarkdownCell[data-windowed-list-index='0'] |
| 98 |
.jp-cell-toolbar { |
| 99 |
top: calc(2 * var(--jp-notebook-padding)); |
| 100 |
} |
| 101 |
|
| 102 |
/** first code cell on mobile |
| 103 |
(keep the selector above the media query) |
| 104 |
*/ |
| 105 |
body[data-notebook='notebooks'] |
| 106 |
.jp-CodeCell[data-windowed-list-index='0'] |
| 107 |
.jp-cell-toolbar { |
| 108 |
top: unset; |
| 109 |
} |
| 110 |
|
| 111 |
@media only screen and (max-width: 760px) { |
| 112 |
/* first code cell on mobile */ |
| 113 |
body[data-notebook='notebooks'] |
| 114 |
.jp-CodeCell[data-windowed-list-index='0'] |
| 115 |
.jp-cell-toolbar { |
| 116 |
top: var(--jp-notebook-padding); |
| 117 |
} |
| 118 |
|
| 119 |
body[data-notebook='notebooks'] .jp-MarkdownCell .jp-cell-toolbar, |
| 120 |
body[data-notebook='notebooks'] .jp-RawCell .jp-cell-toolbar { |
| 121 |
top: calc(0.5 * var(--jp-notebook-padding)); |
| 122 |
} |
| 123 |
} |
| 124 |
|
| 125 |
/* Tweak the notebook footer (to add a new cell) */ |
| 126 |
body[data-notebook='notebooks'] .jp-Notebook-footer { |
| 127 |
width: 100%; |
| 128 |
margin-left: unset; |
| 129 |
background: unset; |
| 130 |
} |
| 131 |
|
| 132 |
/* Mobile View */ |
| 133 |
|
| 134 |
body[data-format='mobile'] .jp-NotebookCheckpoint { |
| 135 |
display: none; |
| 136 |
} |
| 137 |
|
| 138 |
body[data-format='mobile'] .jp-Notebook > *:first-child { |
| 139 |
margin-top: 0; |
| 140 |
} |
| 141 |
|
| 142 |
body[data-format='mobile'] .jp-ToolbarButton .jp-DebuggerBugButton { |
| 143 |
display: none; |
| 144 |
} |
| 145 |
|
| 146 |
/* Virtual Notebook fixes */ |
| 147 |
|
| 148 |
body[data-notebook='notebooks'] .jp-WindowedPanel-window { |
| 149 |
background: var(--jp-layout-color0); |
| 150 |
} |
| 151 |
|
| 152 |
/* Notebook box shadow */ |
| 153 |
|
| 154 |
body[data-notebook='notebooks'] .jp-Notebook > *:first-child:not(:last-child) { |
| 155 |
box-shadow: var(--jp-elevation-z4); |
| 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 */ |
| 184 |
|
| 185 |
.jp-NotebookKernelLogo { |
| 186 |
flex: 0 0 auto; |
| 187 |
display: flex; |
| 188 |
align-items: center; |
| 189 |
text-align: center; |
| 190 |
margin-right: 8px; |
| 191 |
} |
| 192 |
|
| 193 |
.jp-NotebookKernelLogo img { |
| 194 |
max-width: 28px; |
| 195 |
max-height: 28px; |
| 196 |
display: flex; |
| 197 |
} |
| 198 |
|
| 199 |
.jp-NotebookKernelStatus { |
| 200 |
margin: 0; |
| 201 |
font-weight: normal; |
| 202 |
font-size: var(--jp-ui-font-size1); |
| 203 |
color: var(--jp-ui-font-color0); |
| 204 |
font-family: var(--jp-ui-font-family); |
| 205 |
line-height: var(--jp-private-title-panel-height); |
| 206 |
padding-left: var(--jp-kernel-status-padding); |
| 207 |
padding-right: var(--jp-kernel-status-padding); |
| 208 |
} |
| 209 |
|
| 210 |
.jp-NotebookKernelStatus-error { |
| 211 |
background-color: var(--jp-error-color0); |
| 212 |
} |
| 213 |
|
| 214 |
.jp-NotebookKernelStatus-warn { |
| 215 |
background-color: var(--jp-warn-color0); |
| 216 |
} |
| 217 |
|
| 218 |
.jp-NotebookKernelStatus-info { |
| 219 |
background-color: var(--jp-info-color0); |
| 220 |
} |
| 221 |
|
| 222 |
.jp-NotebookKernelStatus-fade { |
| 223 |
animation: 0.5s fade-out forwards; |
| 224 |
} |
| 225 |
|
| 226 |
.jp-NotebookTrustedStatus { |
| 227 |
background: var(--jp-layout-color1); |
| 228 |
color: var(--jp-ui-font-color1); |
| 229 |
margin-top: 4px; |
| 230 |
margin-bottom: 4px; |
| 231 |
border: solid 1px var(--jp-border-color2); |
| 232 |
cursor: help; |
| 233 |
} |
| 234 |
|
| 235 |
.jp-NotebookTrustedStatus-not-trusted { |
| 236 |
cursor: pointer; |
| 237 |
} |
| 238 |
|
| 239 |
@keyframes fade-out { |
| 240 |
0% { |
| 241 |
opacity: 1; |
| 242 |
} |
| 243 |
100% { |
| 244 |
opacity: 0; |
| 245 |
} |
| 246 |
} |
| 247 |
|
| 248 |
#jp-title h1 { |
| 249 |
cursor: pointer; |
| 250 |
font-size: 18px; |
| 251 |
margin: 0; |
| 252 |
font-weight: normal; |
| 253 |
color: var(--jp-ui-font-color0); |
| 254 |
font-family: var(--jp-ui-font-family); |
| 255 |
line-height: calc(1.5 * var(--jp-private-title-panel-height)); |
| 256 |
text-overflow: ellipsis; |
| 257 |
overflow: hidden; |
| 258 |
white-space: nowrap; |
| 259 |
} |
| 260 |
|
| 261 |
#jp-title h1:hover { |
| 262 |
background: var(--jp-layout-color2); |
| 263 |
} |
| 264 |
|
| 265 |
.jp-NotebookCheckpoint { |
| 266 |
font-size: 14px; |
| 267 |
margin-left: 5px; |
| 268 |
margin-right: 5px; |
| 269 |
font-weight: normal; |
| 270 |
color: var(--jp-ui-font-color0); |
| 271 |
font-family: var(--jp-ui-font-family); |
| 272 |
line-height: calc(1.5 * var(--jp-private-title-panel-height)); |
| 273 |
text-overflow: ellipsis; |
| 274 |
overflow: hidden; |
| 275 |
white-space: nowrap; |
| 276 |
} |
| 277 |
|
| 278 |
.jp-skiplink { |
| 279 |
position: absolute; |
| 280 |
top: -100em; |
| 281 |
} |
| 282 |
|
| 283 |
.jp-skiplink:focus-within { |
| 284 |
position: absolute; |
| 285 |
z-index: 10000; |
| 286 |
top: 0; |
| 287 |
left: 46%; |
| 288 |
margin: 0 auto; |
| 289 |
padding: 1em; |
| 290 |
width: 15%; |
| 291 |
box-shadow: var(--jp-elevation-z4); |
| 292 |
border-radius: 4px; |
| 293 |
background: var(--jp-layout-color0); |
| 294 |
text-align: center; |
| 295 |
} |
| 296 |
|
| 297 |
.jp-skiplink:focus-within a { |
| 298 |
text-decoration: underline; |
| 299 |
color: var(--jp-content-link-color); |
| 300 |
} |