Coqide: What settings can I set in the gtk.css?

Hello all,

Firstly this is my first time using this forum - whilst I’ve read the guidelines I don’t have a working model of the de facto rules for good behavior / interactions here, so please let me know if I’m being uncouth!

I’ve just got a quick question related to customizing the interface of coqide and this forum seems lie the best place to ask.

I’ve been using the coqide a lot recently (and great tool I must add!). I had been resigned to using light-mode because there was no option in the editor preferences, but noticing my eye strain caused me to have another crack at the problem and discovered being able to use gtk.css to use css to control for background colour.

My current gtk.css is as follows:

@define-color background_colour black;
textview text {
	background-color: @background_colour;
}

That’s great and sorts out the background / eyestrain problem but leaves me with two further questions that I cannot solve myself:

  1. the background to the toolbar / space between the three text boxes in the editor is still that beige colour which, whilst well fitting for a white background, is a little jaring in a dark theme.

  2. My theme config is now split into two places - the preferences menu in-editor for text/syntax highlighting and the gtk.css for background. As the text colour choices that look good for lightmode differ from those that are readable in dark-mode, I would like to move all the syntax-highlighting settings into the .css if at all possible that way I can instantly switch between the two without having to manually edit a bunch of colour preferences.

I presume (hope) there are css-settings in the gtk.css that can set the required properties to sort out both of these issues - however I can find no documentation on what gtk.css settings coqide supports.

Can anyone who knows their way around coqide internals / gtk provide insight into this problem?

Update - I have fallen down a rabbit hole w.r.t. GTK and it seems I can solve the first problem easily.

My second question however I haven’t had any luck. And testing out using a css selector of the form:

* {
	color:				white;
	background-color:	black;	 
}

to brute force the issue leads me to believe that setting the syntax highlighting is not possible using gtk.css.

In this case I ask if there is any setting files for coqide that I can manually keep track of or are they all unstable i.e. would a update to coq/coqide break them?

As far as I know, none. (The code of coqide predates theming through gtk.css, and nobody bothered adapting the code once GTK added support for CSS theming.) So, you won’t be able to move things into gtk.css.

That said, you should not need to manually edit your color scheme every time. You could just save and restore the file coqiderc which contains the information.

1 Like

Thanks for the info on coqiderc - that’s really useful to know.