Skip to content

Commit

Permalink
Don't override Pygments background color in code cells
Browse files Browse the repository at this point in the history
Closes #447.
  • Loading branch information
mgeier committed Jul 18, 2020
1 parent 8211cb7 commit 5daba66
Showing 1 changed file with 23 additions and 13 deletions.
36 changes: 23 additions & 13 deletions src/nbsphinx.py
Original file line number Diff line number Diff line change
Expand Up @@ -426,23 +426,32 @@
/* CSS for nbsphinx extension */
/* remove conflicting styling from Sphinx themes */
div.nbinput.container,
div.nbinput.container div.prompt,
div.nbinput.container div.input_area,
div.nbinput.container div[class*=highlight],
div.nbinput.container div[class*=highlight] pre,
div.nboutput.container,
div.nboutput.container div.prompt,
div.nboutput.container div.output_area,
div.nboutput.container div[class*=highlight],
div.nboutput.container div[class*=highlight] pre {
background: none;
div.nbinput.container div.prompt *,
div.nboutput.container div.prompt *,
div.nbinput.container div.input_area pre,
div.nboutput.container div.output_area pre,
div.nbinput.container div.input_area .highlight,
div.nboutput.container div.output_area .highlight {
border: none;
padding: 0 0;
padding: 0;
margin: 0;
box-shadow: none;
}
div.nbinput.container div.prompt *,
div.nboutput.container div.prompt * {
background: none;
}
div.nboutput.container div.output_area .highlight,
div.nboutput.container div.output_area pre {
background: unset;
}
div.nboutput.container div.output_area div.highlight {
color: unset; /* override Pygments text color */
}
/* avoid gaps between output lines */
div.nboutput.container div[class*=highlight] pre {
line-height: normal;
Expand Down Expand Up @@ -541,7 +550,7 @@
div.nbinput.container div.input_area {
border: 1px solid #e0e0e0;
border-radius: 2px;
background: #f5f5f5;
/*background: #f5f5f5;*/
}
/* override MathJax center alignment in output cells */
Expand Down Expand Up @@ -607,6 +616,7 @@
div.nboutput.container div.output_area > div.output_javascript,
div.nboutput.container div.output_area:not(.rendered_html) > img{
padding: 5px;
margin: 0;
}
/* fix copybtn overflow problem in chromium (needed for 'sphinx_copybutton') */
Expand Down

0 comments on commit 5daba66

Please sign in to comment.