Search code examples
cssgtk

How to make a GtkButton fully invisible


I have a grid of buttons in which it is easier for me to make some buttons invisible then not creating them. They have no function and are only placeholder. They have a styleclass attached to them called transparent. I was mostly able to hide them but there is still a line around them left that is not fully transparent. It kinda looks like the shadow of the button or something. I tried hiding them with the following CSS:

.transparent {
  background: transparent;
  outline-color: transparent;
  border-color: transparent;
  color: transparent;
}

How can I hide that last bit of the buttons? They are ToggleButtons. Not sure if that is important


Solution

  • Even though I am using GTK3 I looked at the documentation for GTK4 and there I found the right property. It was indeed a shadow and it can be removed with: box-shadow: none;

    My solution now looks like:

    .transparent {
      background: transparent;
      outline-color: transparent;
      border-color: transparent;
      color: transparent;
      box-shadow: none;
    }