Skip to content

Is there a way to change the color of the executable code cells? #667

Answered by choldgraf
dprada asked this question in Q&A
Discussion options

You must be logged in to vote

Your easiest bet would be to define some CSS rules that are applied to your book.

Here's a guide for adding custom CSS with the book.

You'll then need to figure out the selector + rule that will make the change you need. Currently, the cell inputs can be matched with a selector like div.cell div.cell_input. So to change the color of the left bar, you could add a selector like this:

div.cell div.cell_input {
    border-left-color: red;
}

Note that this will break if the HTML structure of notebook cells changes in Jupyter Book (which it might, see this issue for a proposal to change the HTML structure)

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by dprada
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants