Skip to Content
mangobar

Styling

Style mangobar modules using its supported CSS subset.

~/.config/mangobar/style.css supports a small, focused CSS subset.

Supported Properties

PropertyDescription
colorForeground color
background / background-colorBackground (solid color or linear-gradient)
padding / padding-left / padding-rightInner spacing
margin / margin-top / margin-left / margin-rightOuter spacing
border-radiusCorner radius (-1 = pill, 0 = square)
min-widthMinimum module width
font-family / font-size / font-weightFont settings (global only)

Colors

Colors can be written as #hex values (#RGB, #RRGGBB, #AARRGGBB), @define-color variables, or the keyword none (transparent).

@define-color color-workspace-button-bg #504945;
@define-color color-gradient-fade #fbf1c7;

#tags {
  background-color: @color-workspace-button-bg;
  color: #ebdbb2;
}

Gradients

Backgrounds accept real two-color linear-gradient:

background: linear-gradient(to top, #504945, mix(#504945, #fbf1c7, 0.3));

Directions: to top, to bottom, to left, to right (default to bottom). Color stops can use @vars and mix(color1, color2, ratio):

#workspaces button:hover {
  background: linear-gradient(
    to top,
    @color-workspace-button-hover-bg,
    mix(@color-workspace-button-hover-bg, @color-gradient-fade, 0.25)
  );
  color: @color-workspace-button-hover-fg;
}

Selectors

SelectorApplies to
*All modules (global defaults)
#moduleA module, e.g. #cpu, #battery, #clock.date
#module.stateA module state, e.g. #tags.active, #tags.urgent
#custom-<name>A custom module
#workspaces buttonAlias for #tags
#workspaces button:hoverAlias for #tags:hover (real hover state)

CSS priority is $MANGOBAR_CSS > ~/.config/mangobar/style.css.

Tag states

StateMeaning
#tags.activeFocused tag
#tags.occupiedTag with visible clients
#tags.urgentTag with an urgent client
#tags.emptyEmpty tag
#tags:hoverTag under the pointer

Network states

States can be combined: a connected wifi link matches both #network.connected and #network.wifi.

StateMeaning
#network.connectedAn interface is up (default route present)
#network.disconnectedNo active interface
#network.wifiThe active interface is wireless
#network.ethernetThe active interface is wired

Full example

See the bundled style.css.example.

Last updated on

On this page