ghostty icon indicating copy to clipboard operation
ghostty copied to clipboard

GTK: ability to load custom CSS

Open mitchellh opened this issue 1 year ago • 3 comments

Discussed in https://github.com/ghostty-org/ghostty/discussions/4088

Originally posted by jcollie December 30, 2024 Add a config entry gtk-custom-css that, when set, will load custom CSS from a file. The setting can be repeated to load multiple files and files can be marked as optional by prefixing it with a ?. The custom CSS will be added as priority USER so it should take precedence over any CSS set by Ghostty or the system

mitchellh avatar Dec 30 '24 16:12 mitchellh

Very nice idea, but certainly not the highest priority; the extremely sane defaults, simple config syntax (simplicity is a virtue), built-in theme browser, etc., already make the first public ghostty release super nice. (thank you Mitchell!)

"The setting can be repeated to load multiple files and files can be marked as optional by prefixing it with a ?."

Prefixing "it," meaning the filename referenced in the setting? e.g., gtk-custom-css = ?/full-path/my-style.css

And what is the behavior difference using ? prefix to mark config entry as optional vs. commenting out the line?

gold avatar Dec 30 '24 17:12 gold

Prefixing "it," meaning the filename referenced in the setting? e.g., gtk-custom-css = ?/full-path/my-style.css

And what is the behavior difference using ? prefix to mark config entry as optional vs. commenting out the line?

Yes, this behavior comes "for free" in a sense, it's already used by config-file. The behavior is fully documented for that if you want to take a look!

mitchellh avatar Dec 30 '24 18:12 mitchellh

And what is the behavior difference using ? prefix to mark config entry as optional vs. commenting out the line?

In this particular case, marking a file as optional means that Ghostty won't log a warning if the file doesn't exist. Basically it's a way to have custom configuration for different systems by adding/removing files rather than rewriting your config file.

jcollie avatar Dec 30 '24 18:12 jcollie