Skip to main content
Version: 0.0.4

CSS Reference

Complete reference for histuid CSS selectors and GTK4 CSS properties.

Class Hierarchy

.notification-popup                     <- Root container
│ ├── .light <- Light mode
│ ├── .dark <- Dark mode
│ ├── .urgency-low <- Low urgency
│ ├── .urgency-normal <- Normal urgency
│ ├── .urgency-critical <- Critical urgency
│ ├── .translucent <- Transparent background
│ ├── .app-{name} <- Per-app styling hook
│ ├── .category-{name} <- Per-category styling hook
│ ├── .has-default-action <- Clickable notification
│ ├── .is-clickable <- Alias for has-default-action
│ └── .has-visible-actions <- Has displayable action buttons

├── .notification-header <- Horizontal container
│ ├── .notification-icon <- App icon (48x48)
│ ├── .notification-summary <- Title
│ ├── .notification-appname <- App name
│ ├── .notification-timestamp <- Time
│ └── .notification-stack-count <- Badge

├── .notification-body <- Body text
│ └── link <- Hyperlinks

├── .notification-progress <- Progress bar
│ └── trough > progress <- Fill

├── .notification-image <- Embedded image (non-cropped)

├── .notification-image-container <- Container for cropped images
│ ├── .cropped <- Added when image is cropped
│ ├── .notification-image-box <- Box holding the image
│ │ └── .notification-image <- The image itself
│ └── .notification-image-fade <- Gradient overlay for cropped images

└── .notification-actions <- Action buttons container
└── .notification-action <- Individual button

Container Classes

ClassElement
.notification-popupMain popup container
.notification-headerHeader row (icon + text)
.notification-contentContent area
.notification-actionsAction buttons container

Text Classes

ClassElement
.notification-summaryTitle/summary text
.notification-bodyBody text
.notification-appnameApplication name label
.notification-timestampTime label

Widget Classes

ClassElement
.notification-iconApplication icon
.notification-actionIndividual action button
.notification-progressProgress bar
.notification-imageEmbedded image
.notification-stack-countStacked notification badge

Image Classes

Classes for notification images and cropped image handling:

ClassElement
.notification-imageThe image element itself
.notification-image-containerContainer for cropped images
.notification-image-container.croppedApplied when image is cropped
.notification-image-boxInner box holding the image
.notification-image-fadeGradient overlay on cropped images

Image Cropping Behavior

When notification images exceed the maximum height (150px by default):

  1. The image is placed in a .notification-image-container.cropped wrapper
  2. A .notification-image-fade overlay is added to indicate truncation
  3. The fade uses a gradient that blends to @window_bg_color

See Layout Reference for more details on image sizing rules.

Urgency Classes

Applied to .notification-popup:

ClassWhen Applied
.urgency-lowLow urgency notifications
.urgency-normalNormal urgency (default)
.urgency-criticalCritical/high urgency

Per-App Classes

Dynamic classes based on application name (sanitized to valid CSS):

ClassExample Apps
.app-discordDiscord
.app-firefoxFirefox
.app-slackSlack
.app-spotifySpotify
.app-vs-codeVS Code (spaces become hyphens)

Example usage:

/* Discord - purple accent */
.notification-popup.app-discord {
border-left: 4px solid #5865F2;
}

/* Slack - brand color */
.notification-popup.app-slack {
border-left: 4px solid #4A154B;
}

Category Classes

Based on the Desktop Notifications Specification:

ClassCategory
.category-deviceDevice events
.category-device-addedDevice was added
.category-device-removedDevice was removed
.category-emailEmail notification
.category-email-arrivedNew email arrived
.category-imInstant message
.category-im-receivedIM received
.category-networkNetwork event
.category-network-connectedNetwork connected
.category-transferFile transfer
.category-transfer-completeTransfer complete

State Classes

Applied to .notification-popup:

ClassWhen Applied
.has-bodyNotification has body text
.has-iconNotification has an icon
.has-actionsNotification has any actions
.has-progressNotification has progress bar
.is-residentResident notification
.is-transientTransient notification

Action State Classes

These classes indicate what actions are available on a notification:

ClassWhen Applied
.has-actionsNotification has any action keys (including "default")
.has-default-actionNotification has a "default" action (clickable body)
.is-clickableSemantic alias for .has-default-action
.has-visible-actionsNotification has buttons to display (non-default, non-empty)

Understanding Notification Actions

D-Bus notifications can include actions - clickable buttons or affordances. Actions are key/label pairs:

  • Key: The action identifier (sent back to the app when triggered)
  • Label: The text shown to the user (may be empty)
  • "default" key: Special action triggered by clicking the notification body

Example: Kitty terminal notification

Actions: ["default", ""]  # Empty label, but clicking body focuses kitty window

Example: Discord notification

Actions: ["default", "", "reply", "Reply"]  # Default action + "Reply" button

Styling the Default Action Indicator

The default action indicator is now CSS-based, using the .has-default-action class that's automatically added to clickable notifications. The built-in themes use a right-hand inset shadow effect:

/* Right-hand indicator using inset shadow */
.notification-popup.has-default-action {
/* Customize indicator color (optional - defaults to accent) */
--indicator-color: alpha(@accent_bg_color, 0.35);

/* Inset shadow on right side */
box-shadow:
0 4px 12px alpha(black, 0.15),
inset -20px 0 16px -12px var(--indicator-color);
}

The --indicator-color variable is defined in effects.css and can be overridden per-theme. For example, the catppuccin theme uses mauve:

.notification-popup.has-default-action {
--indicator-color: alpha(var(--ctp-mauve), 0.4);
}

Additional styling options:

/* Subtle cursor change on hover for clickable notifications */
.notification-popup.is-clickable:hover {
cursor: pointer;
border-color: @accent_color;
}

Progress Classes

When .has-progress is applied, one of these is also added:

ClassWhen Applied
.progress-minimalProgress 0-24%
.progress-lowProgress 25-49%
.progress-mediumProgress 50-74%
.progress-highProgress 75-99%
.progress-completeProgress 100%

Stack Position Classes

When multiple notifications are displayed, these classes control how they visually connect:

ClassWhen Applied
.stack-singleOnly one notification visible
.stack-firstFirst in stack (top)
.stack-middleMiddle notification
.stack-lastLast in stack (bottom)

The default theme uses these to create a unified stack appearance:

  • stack-first: Rounded top corners, flat bottom
  • stack-middle: All corners flat, thin separator line
  • stack-last: Flat top, rounded bottom corners

Compositor Integration

Some compositors apply their own corner rounding to layer-shell surfaces, which can interfere with stack styling.

Hyprland: Hyprland applies decoration:rounding globally to layer surfaces. There is no per-surface layer rule to disable this. Options:

  • Set decoration { rounding = 0 } globally (affects all windows)
  • Use display.gap in histuid config to space notifications so rounding looks intentional

Sway: Respects the layer-shell surface styling. No additional configuration needed.

Other Compositors: Consult your compositor's documentation for controlling rounding on layer-shell surfaces with namespace histui-notification.

GTK4/Libadwaita CSS Variables

The default theme uses libadwaita CSS variables for system integration:

VariablePurpose
@window_bg_colorBackground color
@window_fg_colorForeground/text color
@bordersBorder color
@accent_bg_colorAccent background
@accent_fg_colorAccent foreground
@accent_colorPrimary accent
@error_colorError/critical color

Using these variables ensures your theme respects the user's system theme.

Common CSS Properties

Colors

.notification-popup {
background-color: #1e1e2e;
color: #cdd6f4;
border-color: #45475a;
}

Borders

.notification-popup {
border: 1px solid #45475a;
border-radius: 12px;
}

Spacing

.notification-popup {
padding: 12px;
margin: 4px;
}

.notification-content {
margin-left: 12px;
}

Typography

.notification-summary {
font-weight: bold;
font-size: 14px;
}

.notification-body {
font-size: 12px;
font-family: sans-serif;
}

Shadows

.notification-popup {
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}

CSS Animations

GTK4 supports CSS animations via @keyframes. Example pulsing effect:

@keyframes pulse {
0%, 100% { text-shadow: 0 0 4px @error_color; }
50% { text-shadow: 0 0 12px @error_color; }
}

.notification-popup.urgency-critical .notification-summary {
animation: pulse 2s ease-in-out infinite;
}

See Advanced Theming for more animation examples.

Font Variables

Themes can use CSS custom properties for fonts. GTK CSS uses * (universal selector) instead of :root:

* {
--histui-font-family: "Inter", sans-serif;
--histui-font-size: 14px;
}

.notification-popup {
font-family: var(--histui-font-family);
font-size: var(--histui-font-size);
}

These can be overridden via CLI: histuid --font "Ubuntu" --font-size 16

See Also