Q: how to style history buffers

I am making a dark theme for nyxt inspired by that of @aartaka. I struggle on the very last thing, which is the little branch markers in a history buffer. Thanks to inspector, I understand that I must style "ul li::before" and friends but, if I add this to the style of internal-buffer as follows, I get no joy.

("ul li::before"
 :background-color "#4184e4")
("ul li::after"
 :background-color "#4184e4")
("ul li:only-child::before"
 :background-color "#4184e4")

Back to the inspector to discover that history-tree-mode also sets the style and has higher precedence than the internal-buffer style.

So (at last!) my question: how to append to the style slot of history-tree-mode or otherwise achieve the desired effect?

OK, I should have known: modes are classes too and so amenable to define-configuration. In case anyone else needs it, the following does the job:

(define-configuration nyxt/history-tree-mode::history-tree-mode
  ((style
    (str:concat
     %slot-default%
     (cl-css:css
      '(("ul li::before"
	 :background-color "#4184e4")
	("ul li::after"
	 :background-color "#4184e4")
	("ul li:only-child::before"
	 :background-color "#4184e4")))))))

Exactly – the mode-local styles can be overriden in the configuration of the mode itself :slight_smile:

Thanks for the inspiraiton, by the way – I haven’t even thought about coloring these branch markers!

Mind open-sourcing your theme after you’re done with it? I want to have a look at it :slight_smile:

Sure. There is a little more to do here (decide what to do with the status line, extract the style stuff from my init.lisp) but then I will put it on github.

Now on github! Still a work in progress though.

2 Likes

Glad to see this! Regarding URL truncation: I once had a truncation function that you can start from. See status.lisp at GitHub - aartaka/nyxt-config at 6aa9d331ee89a0e0b41698f7a15668cd8be82ba7.

Yet more inspiration from your config. I am very grateful.