Expert blueprint for UI themes using Theme resources, StyleBoxes, custom fonts, and theme overrides for consistent visual styling. Covers StyleBoxFlat/Texture, theme inheritance, dynamic theme switching, and font variations. Use when implementing consistent UI styling OR supporting multiple themes. Keywords Theme, StyleBox, StyleBoxFlat, add_theme_override, font, theme inheritance, dark mode.
Use this skill when the task needs a consistent visual language across multiple UI controls.
Focus:
Theme resourcesStyleBox reuseTheme manager for switching variants and handling fallbacks.
Scaling helper for DPI and resolution-sensitive UI.
StyleBox instances per node when the style belongs in a shared theme.Project Settings -> GUI -> Theme.Theme resource.Control.var style := StyleBoxFlat.new()
style.bg_color = Color.DARK_BLUE
style.corner_radius_all = 5
$Button.add_theme_stylebox_override("normal", style)
Prefer storing shared versions of this in a Theme resource instead of rebuilding them repeatedly.
var font := load("res://fonts/my_font.ttf")
$Label.add_theme_font_override("font", font)
$Label.add_theme_font_size_override("font_size", 24)
Theme.