-
Notifications
You must be signed in to change notification settings - Fork 316
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
FIX: style table generated by myst-NB (#1041)
* FIX: style table generated by myst-NB Fix #1038 * lint * reorder folders
- Loading branch information
Showing
5 changed files
with
92 additions
and
64 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
76 changes: 76 additions & 0 deletions
76
src/pydata_sphinx_theme/assets/styles/extensions/_notebooks.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
/** | ||
* Styles for various Sphinx execution libraries to display pre-executed notebooks. | ||
* For now, where these define output sections, we simply revert their background | ||
* to be a "light theme" background. This ensures that inputs/outputs behave similarly, | ||
* because the CSS is often controlled by each package. | ||
* In the future, we might add dark theme support for specific packages. | ||
*/ | ||
|
||
/******************************************************************************* | ||
* nbsphinx | ||
*/ | ||
|
||
html div.rendered_html { | ||
table { | ||
table-layout: auto; | ||
} | ||
} | ||
|
||
// Dark theme special-cases | ||
html[data-theme="dark"] .bd-content { | ||
.nboutput { | ||
.output_area.rendered_html { | ||
@include cell-output-background; | ||
} | ||
|
||
.output_area.stderr { | ||
background: var(--pst-color-danger); | ||
} | ||
} | ||
} | ||
|
||
// Add extra padding to the final item in an nbsphinx container | ||
div.nblast.container { | ||
margin-bottom: 1rem; | ||
} | ||
|
||
/******************************************************************************* | ||
* myst NB | ||
*/ | ||
|
||
div.cell_output .output { | ||
max-width: 100%; | ||
overflow-x: auto; | ||
|
||
@include scrollbar-style(); | ||
} | ||
|
||
// Dark theme special-cases | ||
html[data-theme="dark"] .bd-content { | ||
div.cell_output { | ||
img, | ||
.text_html { | ||
@include cell-output-background; | ||
} | ||
} | ||
} | ||
|
||
// Prevent tables from scrunching together | ||
.bd-content { | ||
div.cell_input { | ||
display: flex; | ||
flex-direction: column; | ||
justify-content: stretch; | ||
} | ||
|
||
div.cell_input, | ||
div.output { | ||
border-radius: $admonition-border-radius; | ||
} | ||
|
||
div.output { | ||
table { | ||
table-layout: auto; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters