Complete architecture map for theme/style system in wayle-settings
Button rendering uses the wayle-widgets component library and wayle-styling for CSS/themes.
Rendering: GTK4
Styling: CSS (via GTK's CSS provider system)
At startup, Rust generates CSS custom properties (variables) based on config values. These are injected as a :root { ... } block.
Base CSS is compiled from SCSS source once, embedded in binary, enhanced by runtime theme variables.
Generated dynamically from active palette (Wayle, Matugen, Wallust, or Pywal):
Set inline by the BarButton component for each button instance:
User selects global rounding preference; translates to semantic tokens:
| Rounding Level | Element Value | Container Value |
|---|---|---|
| none | --radius-none (0px) | --radius-none (0px) |
| sm | --radius-sm (0.375rem ≈ 6px) | --radius-md (0.625rem ≈ 10px) |
| md (default) | --radius-md (0.625rem ≈ 10px) | --radius-lg (0.875rem ≈ 14px) |
| lg | --radius-lg (0.875rem ≈ 14px) | --radius-xl (1.125rem ≈ 18px) |
| full | --radius-full (9999px, pill shape) | --radius-xl (1.125rem ≈ 18px) |
Maps to CSS variables at runtime:
Applied in SCSS:
| Dimension | Value | In Pixels (Global Scale × 1.0) |
|---|---|---|
| Icon Size | $base-btn-icon-size: 1.6rem | ≈ 25.6px |
| Label Size | $base-btn-label-size: 1.04rem | ≈ 16.6px |
| Button Padding | $base-btn-padding: 0.5rem | ≈ 8px |
| Icon-Label Gap | $base-btn-gap: 0.5rem | ≈ 8px |
Three mutually exclusive rendering modes, each with distinct styling:
Structure: Padding applied to content box; gap as margin on label
Colors applied: Icon color, label color, button background
Structure: Icon in colored square inside button padding
Hover state: brightness(1.2) on icon container
Structure: Icon in colored container bleeding to button edge
Hover state: brightness(1.1) on icon container
Note: Radius adapts to orientation (vertical) and icon position (end)
Defined via CSS filters and brightness modulation:
| Variant | Hover Filter | Active (:checked) Filter |
|---|---|---|
| Basic | brightness(1.15) | brightness(0.95) |
| IconSquare | brightness(1.2) on icon-container | — |
| BlockPrefix | brightness(1.1) on icon-container | — |
| Purpose | File Path |
|---|---|
| Button component (Relm4) | crates/wayle-widgets/src/components/bar_buttons/component.rs |
| Button styling (CSS generation) | crates/wayle-widgets/src/components/bar_buttons/styling.rs |
| Button SCSS (all variants) | crates/wayle-styling/scss/components/bar_button/ (4 files) |
| Design tokens (SCSS) | crates/wayle-styling/scss/tokens/_index.scss |
| Theme generation (Rust) | crates/wayle-styling/src/lib.rs:54–151 |
| CSS loading (app startup) | crates/wayle-settings/src/app/css.rs |
| Rounding config types | crates/wayle-config/src/schemas/styling/types/rounding.rs |
| Bar config schema | crates/wayle-config/src/schemas/bar/mod.rs |