|
12 | 12 | --mystnb-hide-prompt-opacity: 70%; |
13 | 13 | --mystnb-source-border-radius: .4em; |
14 | 14 | --mystnb-source-border-width: 1px; |
| 15 | + --mystnb-scrollbar-width: 0.3rem; |
| 16 | + --mystnb-scrollbar-height: 0.3rem; |
| 17 | + --mystnb-scrollbar-thumb-color: #c1c1c1; |
| 18 | + --mystnb-scrollbar-thumb-hover-color: #a0a0a0; |
| 19 | + --mystnb-scrollbar-thumb-border-radius: 0.25rem; |
15 | 20 | } |
16 | 21 |
|
17 | 22 | /* Whole cell */ |
@@ -217,6 +222,73 @@ tbody span.pasted-inline img { |
217 | 222 | max-height: none; |
218 | 223 | } |
219 | 224 |
|
| 225 | + |
| 226 | +/* Adding scroll bars if tags: output_scroll, scroll-output, and scroll-input |
| 227 | + * On screens, we want to scroll, but on print show all |
| 228 | + * |
| 229 | + * It was before in https://github.com/executablebooks/sphinx-book-theme/blob/eb1b6baf098b27605e8f2b7b2979b17ebf1b9540/src/sphinx_book_theme/assets/styles/extensions/_myst-nb.scss |
| 230 | +*/ |
| 231 | + |
| 232 | +div.cell.tag_output_scroll div.cell_output, div.cell.tag_scroll-output div.cell_output { |
| 233 | + max-height: 24em; |
| 234 | + overflow-y: auto; |
| 235 | + max-width: 100%; |
| 236 | + overflow-x: auto; |
| 237 | +} |
| 238 | + |
| 239 | +div.cell.tag_output_scroll div.cell_output::-webkit-scrollbar, div.cell.tag_scroll-output div.cell_output::-webkit-scrollbar { |
| 240 | + width: var(--mystnb-scrollbar-width); |
| 241 | + height: var(--mystnb-scrollbar-height); |
| 242 | +} |
| 243 | + |
| 244 | +div.cell.tag_output_scroll div.cell_output::-webkit-scrollbar-thumb, div.cell.tag_scroll-output div.cell_output::-webkit-scrollbar-thumb { |
| 245 | + background: var(--mystnb-scrollbar-thumb-color); |
| 246 | + border-radius: var(--mystnb-scrollbar-thumb-border-radius); |
| 247 | +} |
| 248 | + |
| 249 | +div.cell.tag_output_scroll div.cell_output::-webkit-scrollbar-thumb:hover, div.cell.tag_scroll-output div.cell_output::-webkit-scrollbar-thumb:hover { |
| 250 | + background: var(--mystnb-scrollbar-thumb-hover-color); |
| 251 | +} |
| 252 | + |
| 253 | +@media print { |
| 254 | + div.cell.tag_output_scroll div.cell_output, div.cell.tag_scroll-output div.cell_output { |
| 255 | + max-height: unset; |
| 256 | + overflow-y: visible; |
| 257 | + max-width: unset; |
| 258 | + overflow-x: visible; |
| 259 | + } |
| 260 | +} |
| 261 | + |
| 262 | +div.cell.tag_scroll-input div.cell_input { |
| 263 | + max-height: 24em; |
| 264 | + overflow-y: auto; |
| 265 | + max-width: 100%; |
| 266 | + overflow-x: auto; |
| 267 | +} |
| 268 | + |
| 269 | +div.cell.tag_scroll-input div.cell_input::-webkit-scrollbar { |
| 270 | + width: var(--mystnb-scrollbar-width); |
| 271 | + height: var(--mystnb-scrollbar-height); |
| 272 | +} |
| 273 | + |
| 274 | +div.cell.tag_scroll-input div.cell_input::-webkit-scrollbar-thumb { |
| 275 | + background: var(--mystnb-scrollbar-thumb-color); |
| 276 | + border-radius: var(--mystnb-scrollbar-thumb-border-radius); |
| 277 | +} |
| 278 | + |
| 279 | +div.cell.tag_scroll-input div.cell_input::-webkit-scrollbar-thumb:hover { |
| 280 | + background: var(--mystnb-scrollbar-thumb-hover-color); |
| 281 | +} |
| 282 | + |
| 283 | +@media print { |
| 284 | + div.cell.tag_scroll-input div.cell_input { |
| 285 | + max-height: unset; |
| 286 | + overflow-y: visible; |
| 287 | + max-width: unset; |
| 288 | + overflow-x: visible; |
| 289 | + } |
| 290 | +} |
| 291 | + |
220 | 292 | /* Font colors for translated ANSI escape sequences |
221 | 293 | Color values are copied from Jupyter Notebook |
222 | 294 | https://github.com/jupyter/notebook/blob/52581f8eda9b319eb0390ac77fe5903c38f81e3e/notebook/static/notebook/less/ansicolors.less#L14-L21 |
|
0 commit comments