Overview
Themes in Godot provide a powerful system for styling UI elements. ATheme resource stores colors, fonts, icons, constants, and StyleBoxes that can be applied to Control nodes, allowing consistent visual design across your entire application.
Theme resources can be shared across multiple controls and even exported as separate files for reuse across projects.
Theme System
Applying Themes
Themes can be applied at three levels:- Project-wide - Set in
ProjectSettings.gui/theme/custom - Branch-level - Assign to a control’s
themeproperty - Local overrides - Use
add_theme_*_override()methods
Theme Inheritance
Themes propagate from parent to child controls automatically:Local Theme Overrides
Override specific theme properties for individual controls:Color Overrides
Font Overrides
Constant Overrides
StyleBox
StyleBox is an abstract base class for drawing stylized boxes for UI elements like buttons, panels, and backgrounds.
StyleBoxFlat
Create solid color backgrounds with borders, rounded corners, and shadows:bg_color- Background colorborder_width_*- Border width for each sideborder_color- Border colorcorner_radius_*- Corner radius for rounded cornersshadow_*- Shadow propertiescontent_margin_*- Internal padding
StyleBoxTexture
Use textures for UI backgrounds with nine-patch scaling:Common StyleBox States
Many controls have multiple visual states:Creating Theme Resources
Create themes programmatically:Theme Type Variations
Create variations of existing themes for specialized controls:Content Margins
StyleBoxes define content margins that control internal padding:See Also
Control Nodes
Learn about UI elements that can be themed
Containers
Apply themes to container layouts