GTK3 Use CSS with ID to remove blue frame from GtkEntry

Viewed 327

I am currently trying to do some theming to an application using Gtk3 and Css. Loading the CSS works as the widgets get themes the way I want to. I do this using gtk_widget_set_name and using names in CSS. The problem is, that I want to remove the border of a GtkEntry and need to do this for the :focus state as well.

I tried this:

#address_entry {
    border: none;
    border-style: none;
}

#address_entry:hover {
    border: none;
    border-style: none;
}

#address_entry:focus {
    border: none;
    border-style: none;
}

Which results in the entry not having a border when not in focus, but when in focus my theme displays a blue border.

How can I remove the border for alle states?

1 Answers

If a system theme can remove border from entry, you can too! You just have to figure out what css properties are causing something, which looks like border, to be drawn.

As far as I know, there are 2 properties in entry which may draw something like a border - border itself and box-shadow. Yes, it could be a shadow and not a border which appears on focus in your case.

So setting this style will do what you want --

entry#address_entry {
    border: none;
    box-shadow: none;
}
Related