[IPython-User] changing color theme for paired brackets in notebook

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

[IPython-User] changing color theme for paired brackets in notebook

jfmoulin

Hi!

could anyone point me to a way to tune the color scheme of the ipython notebook? In particular I want to change the color used to highlight paired brackets when the cursor is on one of them (On my machine and with my light colorblindness, the color used is almost indistinguishable from the background)

Many thanks in advance
JF
Helmholtz-Zentrum Geesthacht
Zentrum für Material- und Küstenforschung GmbH
Max-Planck-Straße 1 I 21502 Geesthacht I Deutschland/Germany

Geschäftsführer/Board of Management: Prof. Dr. Wolfgang Kaysser, Dipl.-Ing. Michael Ganß
Vorsitzender des Aufsichtsrates/Chairman of the Supervisory Board: MinDirig Wilfried Kraus
Amtsgericht Lübeck HRB 285 GE (Register Court)
Internet: http://www.hzg.de 
_______________________________________________
IPython-User mailing list
[hidden email]
http://mail.scipy.org/mailman/listinfo/ipython-user
Reply | Threaded
Open this post in threaded view
|

Re: changing color theme for paired brackets in notebook

Matthias Bussonnier
Hi Jean-François, 

Le 26 mai 2014 à 15:41, [hidden email] a écrit :


Hi!

could anyone point me to a way to tune the color scheme of the ipython notebook? In particular I want to change the color used to highlight paired brackets when the cursor is on one of them (On my machine and with my light colorblindness, the color used is almost indistinguishable from the background)

Is this the only color you wish to override or do you want a more custom theme ? 
If the first one you can just create a custom css file, the second one you might want to rebuild the full IPython css theme. 

In both cases, put a css file in your ipython profile, one static/custom/custom/custom.css

for me ~/.ipython/profile_default/static/custom/custom.css
it should already exist and have a comment that look like 

/*
Placeholder for custom user CSS

mainly to be overridden in profile/static/custom/custom.css

This will always be an empty file in IPython
*/

According to codemirror Doc [1] you can style the bracket by targeting the following class : 

CodeMirror-matchingbracket


which mean that the following should work : 

div.CodeMirror span.CodeMirror-matchingbracket {
    color:red;
}

use any color or style you like. 

you can also use any code mirror predefined style if you prefer [2], but it might require a little more of tweaking. 
Here [3] are a few full theme for IPython notebook. 

Cheers, 

-- 
Matthias







Many thanks in advance
JF
Helmholtz-Zentrum Geesthacht
Zentrum für Material- und Küstenforschung GmbH
Max-Planck-Straße 1 I 21502 Geesthacht I Deutschland/Germany

Geschäftsführer/Board of Management: Prof. Dr. Wolfgang Kaysser, Dipl.-Ing. Michael Ganß
Vorsitzender des Aufsichtsrates/Chairman of the Supervisory Board: MinDirig Wilfried Kraus
Amtsgericht Lübeck HRB 285 GE (Register Court)
Internet: http://www.hzg.de  
_______________________________________________
IPython-User mailing list
[hidden email]
http://mail.scipy.org/mailman/listinfo/ipython-user


_______________________________________________
IPython-User mailing list
[hidden email]
http://mail.scipy.org/mailman/listinfo/ipython-user