Over the vacations Passive Star launched the Godot Minimal Theme 2.0. I’ve used the Godot Minimal Theme since it was launched again in April 2024 and I nonetheless imagine that it makes Godot look about pretty much as good as potential (clearly this can be a matter of opinion). The two.0 launch brings a number of new options to the fold:
A number of weeks in the past Yuri Sizov reached out to me and instructed utilizing a built-in script on the theme useful resource itself to mix the common and HiDPI theme assets into one. Initially he instructed to embed two (or extra) theme chunks right into a single useful resource and merge them collectively utilizing Theme.merge_with() relying on chosen editor settings.
After some dialogue we determined that as a substitute of merging two assets it makes extra sense to only generate the entire thing totally from code similar to it’s accomplished within the built-in theme. This offers probably the most management with the least quantity of traces.
This made the theme shrink by 1.3K LOC (~150%), although it does rather more now:
This is because of the truth that the excessive dpi file will not be wanted anymore as a result of the theme can learn editor scale from editor settings to calculate the right margins.
Btw Yuri additionally wrote an in-depth article about this concept, you’ll be able to test it out right here!
The concept is easy – no matter goes into the _init() methodology of the useful resource script will get executed when the theme is loaded, so we are able to make calls to set_constant(), set_stylebox(), set_color(), and so on to generate the theme from the theme itself. After all because it’s GDScript we are able to additionally learn editor settings from it similar to from another instrument script.
And it will get higher – the _init() runs each time any of the theme-related settings are modified within the editor settings. So if you change the bottom coloration or the spacing values godot will regenerate the customized theme mechanically utilizing these values.
It took a number of hours to transform the theme from a useful resource to a script. But it surely took for much longer than that to get rid of all of redundancy, make certain the entire related editor settings are supported and check every thing.
You’ll be able to be taught extra concerning the Godot Minimal Theme 2.0, see a number of variations of Godot going again to 1.1 and see the brand new theme in motion within the video under.