How do i remove outline around text in button ?

Godot Version

4.5

Question

I added a button in this manner


why is there such outline and how do i remove this i tried overriding styles but doesn’t make any change

Assuming that the outline only appears after clicking on the button or pressing Tab

The outline is supposed to show that you are “focussing” the button, which is useful for keyboard navigation.

  1. If you want to ditch focussing altogether you can set the Button’s focus_mode to “None”:
  2. Alternatively, overriding the “Focus” style with a StyleBoxEmpty should work:

Otherwise, could you share an MRP (minimal reproducible project)? There definitely shouldn’t always be an outline around the default buttons

1 Like

That outline comes from the theme. @yesko has your answer if it’s focus related, and otherwise the answer is similar; it’ll be the normal or pressed or hovered style for the button that’s doing it.

1 Like

yeaah the issue that was coming from focus, i changed all and forgot to handle this