Waybar icon indicating copy to clipboard operation
Waybar copied to clipboard

User Module missing CSS classes

Open ndom91 opened this issue 1 year ago • 3 comments

Hey folks, I'm trying to customize the user module a bit, but it doesn't look like there are any CSS classes for the various elements.

The wiki entry doesn't list any CSS at all at the bottom. Seems like there aren't any defined in the user.cpp file to begin with :cry:

I was hoping to be able to round the avatar, for example.

#user .avatar {
  border-radius: 50%;
}

ndom91 avatar Jul 02 '24 11:07 ndom91

You should be able to style #user image, e.g.

#user image {
    border-radius: 50%;
    background-color: #ffffff;
    padding: 5px;
}

if you start waybar with GTK_DEBUG=interactive, you can have a look at the elements including CSS hierarchy.

RobertMueller2 avatar Jul 02 '24 14:07 RobertMueller2

This adds a circular border to the image rather than rounded the image itself

HarshNarayanJha avatar Jul 23 '24 05:07 HarshNarayanJha

It does, but that's a limitation of GtkImage. https://gitlab.gnome.org/GNOME/gtk/-/issues/555

The above is a working CSS selector. It might be more useful once #2815 is implemented. Short of that, somebody would have to implement a custom widget, as suggest in the GTK issue above.

RobertMueller2 avatar Jul 23 '24 06:07 RobertMueller2