GTK: ability to load custom CSS
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
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?
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!
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.