Resource inheritance

Godot Version

4+

Question

I have a StyleBoxFlat (A) resource

[sub_resource type="StyleBoxFlat" id="A"]
content_margin_left = 4.0
content_margin_top = 4.0
content_margin_right = 4.0
content_margin_bottom = 4.0
bg_color = Color(0.225, 0.225, 0.225, 1)

I would like to specify another StyleBoxFlat (B) resource that inherits the first one, and only change one property :

[sub_resource type="StyleBoxFlat" id="B" extend??="A??"]
bg_color = Color(1, 1, 1, 1)

So that StyleBoxFlat (B) has the same margins as StyleBoxFlat (A) , but a different bg color.

Is this at all possible without using scripting ? And without using theme overrides ?

Thanks !

No, Resources can’t be extended. You can create theme variations but you’ll need to configure each resource for each variation.