Alexays / Waybar

Highly customizable Wayland bar for Sway and Wlroots based compositors. :v: :tada:
MIT License
6.38k stars 696 forks source link

Hyprland workspace module height problem #3385

Closed clevrf0x closed 3 months ago

clevrf0x commented 3 months ago

Description

The workspace module in my Waybar is taking up too much space even though I've set padding and margin to 0. The CSS only applies margins on the x-axis, which shouldn't affect the height. Below is the configuration and styling code I'm using for the module on the left panel.

Problem

I want the buttons to have no padding inside them. When running env GTK_DEBUG=interactive waybar, I noticed the button labels have an unusual line-height, which seems to be affecting the Waybar's height.

Similar Issue

Note: The solution for that issue involved setting min-height: 0; globally, but this hasn't resolved my problem.

Configuration and Styling

Config

"modules-left": ["hyprland/workspaces", "custom/weather" ],

"hyprland/workspaces": {
    "disable-scroll": true,
    "all-outputs": true,
    "format": "{icon}",
},

Style

* {
    font-family: JetBrains Mono NF;
    font-size: 14px;
    min-height: 0;
    padding: 0;
    margin: 0;
}

#workspaces {
    background-color: transparent;
}

#workspaces button {
    background-color: @white;
    padding: 0; /* Need buttons with zero padding */
    margin-right: 10px;
    font-weight: bolder;
    color: @black;
}

#workspaces button.active {
    background-color: @green2;
    color: @black;
    font-weight: bolder;
}

Note: I have tried setting font-size: 10px and lower and that doesn't seem to solve the issue either

Screenshots

With hyprland/workspaces

image

Without hyprland/workspaces

image

Additional Notes

clevrf0x commented 3 months ago

I'm sorry for bringing up a redundant issue here. I should have managed the height of each workspace button by adjusting the padding of the parent container named #workspaces. This way, each button would automatically adjust its size.

Example:

#workspaces {
    background-color: transparent;
    padding: 0.3em; /* Adjust padding here */
}