UI Toolbox logoUI Toolbox
Support

Theme variables

The look of the windows and the controls comes from USS variables. A theme is a sheet that sets them. All styling is done with USS. C# adds and removes classes only. It does not set colors.

Rules

  1. Themes/dark.uss is the theme contract. It defines every --tb-* variable.
  2. A theme overrides --tb-* variables only.
  3. WindowStyles.uss uses only the --tb-* variables.
  4. Selectors use the canonical tb-* classes. They do not use element names.

Variable contract

All variables are defined on :root in Assets/UIToolbox/Runtime/Resources/UIToolbox/Themes/dark.uss. The values below are the dark (default) values.

Palette

Variable Dark value Used for
--tb-color-background #1e1e1e Workspace background.
--tb-color-surface #2b2b2b Window and content background.
--tb-color-surface-alt #333333 Title bar, buttons, tab strip.
--tb-color-surface-hover #3d3d3d Hover state.
--tb-color-border #454545 Borders.
--tb-color-text #e6e6e6 Text.
--tb-color-text-muted #b3b3b3 Secondary text (tb-text-muted).
--tb-color-text-disabled #7a7a7a Disabled text.
--tb-color-placeholder #909090 Placeholder text and the search icon.
--tb-color-field The background Background of a text box. Set it only when a skin needs a box other than the background.
--tb-color-accent #0e639c Focused window border and title bar, active tab.
--tb-color-accent-text #ffffff Text on the accent color.
--tb-color-danger #c42b1c Close button hover, error chrome.
--tb-color-danger-text #ffffff Text on the danger color.
--tb-color-text-danger #ee9087 Danger-colored text on the surface: a destructive menu item, an error message, a required mark. It reads 4.5:1 on the theme surface, which --tb-color-danger does not on the dark themes. A skin that changes the surface sets its own value.
--tb-color-success #3fbf77 Success notification stripe.
--tb-color-warning #e89821 Warning notification stripe.
--tb-color-overlay rgba(0, 0, 0, 0.5) The dim overlay behind a dialog, a message box and the other modal overlays.
--tb-color-drop-target rgba(255, 153, 0, 0.8) Drop target highlight.
--tb-color-dock-target rgba(76, 255, 76, 0.8) Dock zone highlight.
--tb-color-preview rgba(77, 153, 255, 0.2) Snap and tear-off preview fill.
--tb-color-preview-border rgba(77, 153, 255, 0.9) Snap and tear-off preview border.
--tb-color-glass-frost rgba(255, 255, 255, 0.01) The frost of all glass: the tint that lies on the blur. It is near clear in every theme, so the blur shows what is behind. Set it to tint the glass of a theme. A project in the linear color space blends a small alpha brighter than it looks, so keep it under 0.03 for clear glass.
--tb-color-glass var(--tb-color-glass-frost) The tint of a glass window (GlassWindowTemplate) over its blur.
--tb-color-glass-dialog var(--tb-color-glass-frost) The tint of a glass message box or dialog (Glass).
--tb-color-glass-border rgba(255, 255, 255, 0.24) The border of a glass window, message box or dialog.
--tb-color-glass-rim rgba(255, 255, 255, 0.55) The light edge at the top of a GlassPanel.
--tb-color-glass-lift rgba(255, 255, 255, 0.08) The light layer on the title bar, the hovered tab and the tab strip of a glass window, and on the title of a glass message box or dialog.
--tb-color-glass-lift-strong rgba(255, 255, 255, 0.18) The same layer for the focused title bar and the active tab.
--tb-color-glass-dark rgba(10, 12, 16, 0.45) The smoked glass of a GlassPanel with Tint set to Dark.
--tb-color-glass-accent rgba(70, 140, 255, 0.22) The tint of a GlassPanel with Tint set to Accent.
--tb-color-glass-accent-rim rgba(190, 220, 255, 0.6) The top edge of an Accent panel.
--tb-color-glass-plate rgba(20, 24, 34, 0.6) The backing of a HUD panel that must read over a bright scene (UnitFrame). It is a plate, not glass: the light themes set a light plate.
--tb-color-glass-text-shadow rgba(0, 0, 0, 0.6) The shadow of the text on a glass window, message box and dialog, so it reads over a busy blur. The light themes set a light shadow.
--tb-color-hud-outline rgba(0, 0, 0, 0.8) The outline of the text of the HUD controls (WorldMarkerLayer, CompassBar, FloatingTextLayer).

Chart colors

PieChart, Graph, SankeyChart, Timeline and Treemap give a series, slice, node, track or item without its own color the next of these colors, in order. The light and toolbox-light themes set darker values for 2, 3, 6, 7 and 8, so each color keeps 3:1 contrast on their light backgrounds. PieChart.Palette holds the dark values and is the fallback when a sheet does not set a variable.

Variable Dark value Used for
--tb-chart-1 #3b82c4 First series (blue).
--tb-chart-2 #f28c33 Second series (orange).
--tb-chart-3 #2ea16e Third series (green).
--tb-chart-4 #d6424d Fourth series (red).
--tb-chart-5 #8c5cb8 Fifth series (purple).
--tb-chart-6 #f2c740 Sixth series (yellow).
--tb-chart-7 #40b3c7 Seventh series (cyan).
--tb-chart-8 #999999 Eighth series (gray).
--tb-chart-text #ffffff The labels drawn on a chart color: PieChart slices, Treemap boxes and Timeline items.

To change the colors of one chart only, set --tb-chart-color-1 to --tb-chart-color-8 on it:

.sales-chart {
    --tb-chart-color-1: #1b9e77;
    --tb-chart-color-2: #d95f02;
}

Item colors

ItemSlot and InventoryGrid draw the border of an item in the color of its rarity, and a shaped InventoryGrid marks the cells under a held item.

Variable Dark value Used for
--tb-rarity-common rgb(157, 157, 157) The border of a Common item (tb-item-slot--common).
--tb-rarity-uncommon rgb(30, 200, 60) The border of an Uncommon item.
--tb-rarity-rare rgb(0, 112, 221) The border of a Rare item.
--tb-rarity-epic rgb(163, 53, 238) The border of an Epic item.
--tb-rarity-legendary rgb(255, 128, 0) The border of a Legendary item.
--tb-color-fits rgba(30, 200, 60, 0.35) A cell under a held item that has room (tb-inventory-grid__cell--fits).
--tb-color-blocked rgba(220, 50, 50, 0.35) A cell under a held item that has none (tb-inventory-grid__cell--blocked).

Spacing, radius, font, border, size

Variable Dark value
--tb-spacing-xs 2px
--tb-spacing-sm 4px
--tb-spacing-md 8px
--tb-spacing-lg 16px
--tb-radius-sm 3px
--tb-radius-md 6px
--tb-font-size-xs 9px
--tb-font-size-sm 11px
--tb-font-size 13px
--tb-font-size-lg 15px
--tb-border-width 1px
--tb-border-width-thick 2px
--tb-size-title-bar 26px
--tb-size-button 20px

Animation

Variable Dark value
--tb-animation-duration-fast 150ms
--tb-animation-duration-normal 300ms
--tb-animation-duration-slow 450ms
--tb-animation-easing-entrance ease-out
--tb-animation-easing-exit ease-in
--tb-animation-easing-default ease-out

Cursors

Each variable holds url("...") x y: a cursor texture and its hotspot. The default values point into Resources/UIToolbox/Cursors/default. See Cursors.

Variable Used by
--tb-cursor-arrow disabled buttons
--tb-cursor-link buttons, tabs, menu items
--tb-cursor-text text fields
--tb-cursor-resize-h, --tb-cursor-resize-v window edges, splitters
--tb-cursor-resize-nwse, --tb-cursor-resize-nesw window corners
--tb-cursor-grab drawer handles, slider thumbs
--tb-cursor-move, --tb-cursor-busy, --tb-cursor-not-allowed your own rules

The minimized height of a window is the measured height of its title bar. If you change --tb-size-title-bar, minimized windows follow it.