Godot ui theming

From nix-community/nur-combined · View interactive version

Godot ui theming is an AI agent skill from the GitHub repository nix-community/nur-combined. 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.

How to use this skill

Skill file

UI Theming

Theme resources, StyleBox styling, font management, and override system define consistent UI visual identity.

Available Scripts

[global_theme_manager.gd](scripts/global_theme_manager.gd)

Expert theme manager with dynamic switching, theme variants, and fallback handling.

[ui_scale_manager.gd](scripts/ui_scale_manager.gd)

Runtime theme switching and DPI/Resolution scale management.

[theme_swapper.gd](scripts/theme_swapper.gd)

Dynamic Dark/Light mode implementation using cascading theme root propagation.

[danger_button_assignment.gd](scripts/danger_button_assignment.gd)

Expert use of theme_type_variation for semantic UI styling without scene duplication.

[dynamic_stylebox_color.gd](scripts/dynamic_stylebox_color.gd)

Safe runtime StyleBox modification. Demonstrates the critical duplicate() pattern for isolated overrides.

[procedural_theme_safe.gd](scripts/procedural_theme_safe.gd)

Reliable theming for generated UI elements using NOTIFICATION_THEME_CHANGED.

[custom_chart_drawing.gd](scripts/custom_chart_drawing.gd)

Pattern for reading active Theme properties (colors, fonts) in custom _draw() logic.

[theme_isolation.gd](scripts/theme_isolation.gd)

Ensuring HUD consistency by isolating nodes from parent themes and referencing Project Defaults.

[pulsating_ui_theme.gd](scripts/pulsating_ui_theme.gd)

Animating UI styles via Tweens. Targets StyleBox properties directly after duplication.

[crisp_ui_scaler.gd](scripts/crisp_ui_scaler.gd)

High-quality resolution-independent scaling using content_scale_factor to maintain font crispness.

[memory_safe_custom_drawing.gd](scripts/memory_safe_custom_drawing.gd)

Fixing the "disappearing stylebox" bug by caching resources at the class level for the RenderingServer.

[rtl_theme_mirroring.gd](scripts/rtl_theme_mirroring.gd)

Bi-directional (RTL/LTR) UI support. Swaps theme variants dynamically based on layout direction.

NEVER Do in UI Theming


  1. Project Settings → GUI → Theme
  2. Create new Theme resource
  3. Assign to root Control node
  4. All children inherit theme

StyleBox Pattern

# Create StyleBoxFlat for buttons
var style := StyleBoxFlat.new()
style.bg_color = Color.DARK_BLUE
style.corner_radius_top_left = 5
style.corner_radius_top_right = 5
style.corner_radius_bottom_left = 5
style.corner_radius_bottom_right = 5

# Apply to button
$Button.add_theme_stylebox_override("normal", style)

Font Loading

# Load custom font
var font := load("res://fonts/my_font.ttf")
$Label.add_theme_font_override("font", font)
$Label.add_theme_font_size_override("font_size", 24)

Reference

Related

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.