๐Ÿ”—Boxxy Theme Engine & API

Boxxy decouples Terminal Palettes (the 16 ANSI colors and canvas background inside the terminal grid) from Application Chrome Themes (crates/themes/src/app_theme.rs and resources/themes/boxxy_skeleton.css).

All widgets below are rendered live in HTML and CSS using Boxxy's exact design tokens, borders, shadows, and padding rules. Use the Live Theme & Accent Playground toolbar to switch themes or override the accent color across every widget on this page in real time.

Theme Preset:
Accent Override:

๐Ÿ”—1. HeaderBar, Terminal Tabs & Unified Window Controls

The main window headerbar (.content-header) hosts the tab bar in the center, the Sidebar Toggle icon button on the left, and the Hamburger Menu button + Window Controls (ร—) on the right.

  • Flush Terminal Tabs: Use crisp 2px @boxxy_ink outlines and @accent_bg_color when selected, with no drop-shadow (box-shadow: none) so tabs sit flush inside the 28px headerbar strip without clipping.
  • Unified Icon Button Sizing: After stripping internal image padding on windowcontrols > button > image, both .content-header button.image-button:not(.flat) and .content-header windowcontrols > button share one single CSS rule (min-width: 24px; min-height: 24px; padding: 0px 6px; margin-top: 6px; margin-bottom: 6px;).
.content-header + tabbar tab + windowcontrols > button Click tabs or buttons to test active states
boxxy-terminal ร—
nvim ยท themes ร—
cargo test ร—

๐Ÿ”—2. Sidebar ViewSwitcher & Navigation Capsule Pills

Unlike terminal tabs, the sidebar header switcher buttons (viewswitcher > button) and selected sidebar rows (.navigation-sidebar > row:selected) float on @sidebar_bg_color and cast tactile 2px 3px 0px @boxxy_shadow offset drop-shadows.

viewswitcher > button + .navigation-sidebar > row Click switcher buttons or list rows
โœฆ AI Chat
๐Ÿฆ– Claw
๐Ÿ”– Bookmarks
๐ŸŽจ Colors
Polishing Boxxy Theme Engine Niko ยท 2m
Trending GitHub CLI Apps Niko ยท 1h
Workspace Refactoring Plan Levi ยท 4h

๐Ÿ”—3. Tactile Buttons (Single Source of Truth Padding)

All standard buttons, action buttons (.suggested-action, .destructive-action), popover menu text rows (modelbutton), and popover segmented buttons (box.linked > button.model) share one single CSS padding rule: min-height: 24px; padding: 5px 10px;. To make a button smaller, apply .compact-btn (min-height: 20px; padding: 2px 8px;) instead of writing per-widget rules.

min-height: 24px; padding: 5px 10px; ยท box-shadow: 2px 3px 0px @boxxy_shadow Click and hold to test active press translation

๐Ÿ”—4. Terminal Context Menu (popover.terminal-menu)

The terminal context menu (popover.terminal-menu > contents) uses @popover_bg_color, which matches @sidebar_bg_color (#2e2e32 in Boxxy Dark), while inner linked button strips (popover.menu box.linked) use @card_bg_color (#26262a) for crisp contrast. Both text items (modelbutton) and segmented buttons (box.linked > button.model) share the exact min-height: 24px; padding: 5px 10px; geometry.

popover.terminal-menu > contents (@popover_bg_color == @sidebar_bg_color) Hover menu rows and segmented buttons
Paste
Select All
New Tab
New Window
Open in Files
Reset
Preferences

๐Ÿ”—5. Preference Rows & Boxed Lists (listbox.boxed-list)

Preference group cards (listbox.boxed-list), action rows, switch rows, and theme selector rows use @card_bg_color with a 2px solid @boxxy_ink outline and a 3px 4px 0px @boxxy_shadow offset shadow.

preferencesgroup listbox.boxed-list + ActionRow + SwitchRow Click the switch to toggle state
Boxxy Dark Carbon dark surfaces with crisp ink borders and peanut green accents.
dark default โœ“
Smart Tab Naming Automatically show active command or directory in tab titles
Open Themes Folder Add or edit .toml community themes in your file manager
๐Ÿ“‚

๐Ÿ”—6. Search Entries & Claw MsgBar (searchentry, .boxxy-msgbar)

Input fields (searchentry, entry:not(.flat), .claw-drawer .boxxy-msgbar) rest on @card_bg_color with a 2px solid @boxxy_ink outline, and switch their outline to @accent_color on :focus-within.

searchentry / .claw-drawer .boxxy-msgbar (:focus-within -> @accent_color) Click inside the input to see the focus outline
๐Ÿฆ–

๐Ÿ”—The 4-Layer GTK CssProvider Cascade

Boxxy styles application chrome using four prioritized GTK 4 CssProvider layers so custom themes can be toggled or hot-reloaded at runtime without restarting the application:

LayerGTK PrioritySourceLifecycleResponsibility
Layer 1 (Base)600 (PRIORITY_APPLICATION)resources/style.cssAlways loadedBase widget geometry, spacing, layout rules, and fallback @define-color tokens for Legacy Adwaita.
Layer 1b (Palette)610 (PRIORITY_APPLICATION + 10)build.rs (generate_gtk_css)Loaded when a terminal palette is selectedTerminal-coupled .terminal-header and .claw-drawer colors when running in Legacy Adwaita mode.
Layer 2 (Skeleton)800 (PRIORITY_USER)resources/themes/boxxy_skeleton.cssLoaded only in Boxxy Theme modePlayful neo-brutalist outlines (@boxxy_ink), tactile offset drop-shadows (@boxxy_shadow), capsule navigation pills, and active button press states.
Layer 3 (Theme Tokens)810 (PRIORITY_USER + 10)AppThemeColors::to_gtk_css()Loaded only in Boxxy Theme modeDefines all semantic @define-color variables from the active built-in or community .toml theme.
Layer 4 (Accent Override)820 (PRIORITY_USER + 20)generate_accent_override_css()Loaded when a custom accent is setOverrides @accent_color, @accent_bg_color, and auto-contrasted @accent_fg_color on top of any active theme.

๐Ÿ”—Official Built-in Palettes (Boxxy Dark & Boxxy Light)

Token (AppThemeColors)Boxxy Dark (boxxy-dark)Boxxy Light (boxxy-light)Surface Role
window_bg#1d1d20#ecfafbPrimary window, dialog, and Claw overlay drawer canvas background.
window_fg#f2f4f2#111418Primary text and icon foreground on window_bg.
sidebar_bg#2e2e32#ffffffLeft sidebar (AI Chat, Claw, Bookmarks, Colors) and Preferences navigation sidebar.
sidebar_fg#f2f4f2#111418Text and icon foreground on sidebar_bg.
card_bg#26262a#ffffffTactile buttons, unselected tabs, preference cards, entries, and linked button strips inside menus.
card_fg#f2f4f2#111418Text and icon foreground on card_bg.
headerbar_bg#1d1d20#ffffffMain content headerbar, dialog headerbars, and non-frosted terminal headerbar.
headerbar_fg#f2f4f2#111418Text and icon foreground on headerbar_bg.
popover_bg#2e2e32#ffffffMatches sidebar_bg. Used by the terminal right-click menu, hamburger menu, command palette, and autocomplete popover.
popover_fg#f2f4f2#111418Text and icon foreground on popover_bg.
accent#7ec868#00acc1Selected tabs, active sidebar rows, active switcher buttons, suggested-action buttons, checked switches, and focus rings.
accent_fg#0d140a#0d1117High-contrast ink text and icons rendered on top of accent surfaces.
ink_border#050505#111418Crisp 2px neo-brutalist outlines and structural pane dividers (@boxxy_ink).
shadow#050505#111418Solid offset drop-shadows (@boxxy_shadow).

๐Ÿ”—Complete @define-color Variable Catalog & Component Mapping

Components never hardcode hex or RGB values for surfaces, borders, or semantic states. Every stylesheet rule references the semantic @define-color variables below:

CSS VariableSource Field / FormulaWhere It Is Used
@window_bg_colorcolors.window_bgMain window background, dialog sheets (@dialog_bg_color), Claw overlay drawer background (.claw-drawer), OSD overlays, bookmark preview frames, and avatar status badges.
@window_fg_colorcolors.window_fgPrimary text inside windows, dialogs (@dialog_fg_color), Claw overlay conversation rows, and OSD overlays.
@sidebar_bg_colorcolors.sidebar_bgLeft workspace sidebar (.sidebar-toolbar, .sidebar-pane) and the Preferences navigation sidebar.
@sidebar_fg_colorcolors.sidebar_fgAll text, icons, and .sidebar-header inside the left sidebar and Preferences sidebar.
@headerbar_bg_colorcolors.headerbar_bgMain window headerbar (.content-header), .terminal-header, and dialog headerbars.
@headerbar_fg_colorcolors.headerbar_fgTitles, buttons, and icons inside .terminal-header, .content-header, and dialog headerbars.
@card_bg_colorcolors.card_bgUnselected terminal tabs, standard tactile buttons, preference boxed-list groups, search & text entries, Claw message bar (.boxxy-msgbar), diagnosis/diff viewer cards, character selector pills, status pills, and linked button strips inside menus (popover.menu box.linked).
@card_fg_colorcolors.card_fgText, labels, and icons inside all @card_bg_color widgets above.
@popover_bg_colorcolors.popover_bgTerminal right-click menu (popover.terminal-menu), hamburger menu (popover.menu), command palette, search popover, and @file autocomplete popover.
@popover_fg_colorcolors.popover_fgMenu items (modelbutton) and labels inside all popovers.
@accent_bg_colorcolors.accentSelected terminal tab, selected sidebar row, active sidebar switcher button, pressed tactile buttons, .suggested-action buttons, hovered popover menu items, checked switches & checkboxes, selected character pills, and theme tag pills.
@accent_fg_colorcolors.accent_fgHigh-contrast text and icons inside all @accent_bg_color surfaces.
@accent_colorcolors.accentFocus outlines on search entries, text inputs, and the Claw message bar (.boxxy-msgbar:focus-within), plus bookmark variable chips and Vibe badges.
@boxxy_inkcolors.ink_border2px solid outlines on tabs, sidebar rows, tactile buttons, window controls, entries, boxed lists, cards, popovers, dialogs, switches, checkboxes, and structural pane dividers.
@boxxy_shadowcolors.shadowHard-edge offset drop-shadows (2px 3px 0px, 3px 4px 0px, 4px 5px 0px) on tactile buttons, selected sidebar pills, boxed lists, cards, popovers, and dialogs.
@boxxy_surface_hovermix(@card_bg_color, @accent_bg_color, 0.82)Vibrant hover background (82% accent + 18% card, paired with @accent_fg_color ink text) for unselected tabs, unselected sidebar rows, tactile buttons, character selector pills, and What's New stat tiles.
@destructive_bg_colorDark: #c01c28 ยท Light: #e01b24Destructive action buttons (.destructive-action), error progress bars, avatar remove badge hover, and diff deletion ratio bars.
@success_bg_colorDark: #26a269 ยท Light: #2ec27eTerminal progress bars, model ready status titles, What's New hero badge, and diff addition counters/bars.

๐Ÿ”—Visual Hierarchy: Shadow vs. Non-Shadow Matrix

ComponentHas @boxxy_shadow?Shadow OffsetRationale
Sidebar Switcher Buttons (viewswitcher > button)Yes2px 3px 0px @boxxy_shadowTop-level mode switchers (AI Chat, Claw, Bookmarks, Colors) sit in the spacious sidebar header with a 2px inter-button gap and act as tactile physical toggles.
Sidebar & Command Palette Rows (.navigation-sidebar > row:selected, :hover, .menu-open)Yes2px 3px 0px @boxxy_shadowLifts the active or hovered conversation, command palette item, bookmark, or preferences category above the flat list. Depresses to 1px 1px 0px on click.
Terminal Tabs (tabbar tab, tabbar tab:selected)No (box-shadow: none)noneTabs live inside the compact 28px tab bar strip. Keeping box-shadow: none (while retaining the 2px @boxxy_ink outline and @accent_bg_color active fill) prevents bottom shadow clipping inside AdwTabBox.
Standalone Tactile Buttons (headerbar button, windowcontrols > button, dialog button)Yes2px 3px 0px @boxxy_shadowPrimary interactive buttons. Depress by translate(1px, 1px) with 1px 1px 0px @boxxy_shadow when clicked.
Popover Linked Button Container (popover.menu box.linked)Yes (Container only)2px 3px 0px @boxxy_shadowThe outer segmented bar (Copy | Copy Link, split/close bar) casts a single unified shadow.
Individual Linked Buttons (popover.menu box.linked > button.model)No (box-shadow: none)noneInner segments are separated by border-right: 2px solid @boxxy_ink inside the shared container; per-segment shadows would overlap adjacent buttons.
Preference Groups & Cards (listbox.boxed-list, .card)Yes3px 4px 0px @boxxy_shadowLarge elevated content containers.
Popovers & Dialog Sheets (popover > contents, dialog sheet)Yes4px 5px 0px @boxxy_shadowHighest elevation layer floating above the window canvas.

๐Ÿ”—Community Theme .toml API Specification

Users and community authors can drop .toml files into ~/.config/boxxy-terminal/themes/ (or $BOXXY_CONFIG_DIR/themes/). On first launch, Boxxy seeds README.md, cotton-candy.toml, and bauhaus.toml into this folder. While Preferences โ†’ Themes is open, Boxxy polls the folder every 500 ms (using a zero-I/O (filename, mtime, size) metadata stamp) and live-reloads any edits immediately.

๐Ÿ”—Full .toml Schema

[meta]
name = "Cotton Candy"                                  # Optional (defaults to filename stem with spaces)
author = "nukeop"                                      # Optional (defaults to "community")
description = "Soft pastels in baby pink and blue"     # Optional (defaults to "")
mode = "light"                                         # Optional: "light" or "dark" (auto-detected from window_bg luminance if omitted)
tags = ["pastel", "pink", "cute"]                      # Optional: up to 6 tags (first 3 shown as pills in Preferences)

[colors]
# --- REQUIRED (3 fields) ---
window_bg = "#fff5f8"
window_fg = "#1e1b24"
accent    = "#ff7eb6"

# --- OPTIONAL (11 fields โ€” automatically derived if omitted) ---
sidebar_bg   = "#fce8ef"   # Defaults to `window_bg`
sidebar_fg   = "#1e1b24"   # Defaults to `window_fg`
card_bg      = "#ffffff"   # Defaults to `window_bg`
card_fg      = "#1e1b24"   # Defaults to `window_fg`
headerbar_bg = "#fce8ef"   # Defaults to `sidebar_bg`
headerbar_fg = "#1e1b24"   # Defaults to `sidebar_fg`
popover_bg   = "#fce8ef"   # Defaults to `sidebar_bg` (matches sidebar surface!)
popover_fg   = "#1e1b24"   # Defaults to `sidebar_fg`
accent_fg    = "#1e1b24"   # Defaults to `contrast_fg_for_hex(accent)` (#ffffff or #111418)
ink_border   = "#1e1b24"   # Defaults to "#07080c" (dark mode) or "#111418" (light mode)
shadow       = "#1e1b24"   # Defaults to `ink_border`

๐Ÿ”—Automatic Fallback Derivation Chain

A valid community theme only requires 3 colors (window_bg, window_fg, accent). All remaining tokens derive automatically in parse_community_theme_toml():

window_bg โ”€โ”€โ”ฌโ”€โ”€โ–บ sidebar_bg โ”€โ”€โ”ฌโ”€โ”€โ–บ headerbar_bg
            โ”‚                 โ””โ”€โ”€โ–บ popover_bg
            โ””โ”€โ”€โ–บ card_bg

window_fg โ”€โ”€โ”ฌโ”€โ”€โ–บ sidebar_fg โ”€โ”€โ”ฌโ”€โ”€โ–บ headerbar_fg
            โ”‚                 โ””โ”€โ”€โ–บ popover_fg
            โ””โ”€โ”€โ–บ card_fg

accent โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ–บ accent_fg (via relative luminance: < 0.38 โ†’ #ffffff, >= 0.38 โ†’ #111418)

mode (is_dark) โ–บ ink_border (#07080c if dark, #111418 if light) โ”€โ”€โ–บ shadow

๐Ÿ”—Security & Validation (sanitize_hex_color)

  • Every color string in [colors] (and any user custom_accent_color) is validated through sanitize_hex_color(raw: &str) -> Option<String>.
  • Only exact 6-digit (#RRGGBB) or 8-digit (#RRGGBBAA) ASCII hexadecimal strings are accepted.
  • Any invalid hex or CSS injection attempt (e.g., #ffffff; @import ... or arbitrary CSS rules) returns None, guaranteeing community themes can never break widget geometry or inject arbitrary CSS.