Skip to content

Theme ​

Css variables set the theme. The names follow daisyUI with the prefix --twk-. Set them on the panel (.tweak-ui) or on an ancestor. The classes twk-dark and twk-light select the built-in dark and light themes.

VariableDefaultUse
--twk-color-base-100#2a303cbuttons, controls on hover
--twk-color-base-200#242933panel background
--twk-color-base-300#20252edark surfaces, e.g. the tab strip
--twk-color-base-content#b2ccd6text
--twk-color-neutral#1c212bgroup title background
--twk-color-neutral-content#b2ccd6group title text
--twk-color-accent#f9aa33focus, active states, highlights, accent buttons
--twk-color-accent-content#1c212btext on the accent color
--twk-color-info, -success, -warning, -error#61afef, #98c379, #e5c07b, #e06c75status colors of badges and alerts
--twk-color-info-content, -success-content, ...#1c212btext on the status colors
--twk-spacing-gap0.125remgap between elements, e.g. rows and the children of containers
--twk-spacing0.25remunit of the paddings in controls
--twk-spacing-field1.375remheight of a row, an input and a button
--twk-spacing-inset0.125rempadding of the panel
--twk-radius-field0.25remcorner radius of buttons, inputs and tabs
--twk-radius-box0.25remcorner radius of boxes, e.g. dialogs, popovers and dropdowns
--twk-radius-selector0.25remcorner radius of small controls, e.g. checkboxes
--twk-text-ui12pxfont size
--twk-font-uimonospacefont
--twk-width20remwidth of the panel
css
.tweak-ui {
  --twk-color-accent: #2196f3;
  --twk-spacing-field: 1.5rem;
}

Colors ​

The base colors are elevations. Each one has a single role:

ColorRoleUse
base-300sunkeninput fields, strips (toolbar, tab list), tracks, checkboxes
base-200surfacethe panel, dialogs, popovers, dropdowns, the active tab
base-100raisedbuttons, knobs, the hover and active state of rows and fields
neutralbandtitle bars, e.g. of a group. Only text, icons and ghost buttons on it
accentsignalfocus, selection, checked state, the primary action. Never a surface

Rules, for components and for content in a panel:

  1. A control is one step away from the surface it is on. On base-200, a button is base-100 and an input field is base-300. On a base-300 strip, buttons are ghost buttons with a base-100 hover.
  2. Never put a color on the same color, e.g. a base-100 button on a base-100 box.
  3. Every surface is base-200. A floating surface (dialog, popover) is set apart by a shadow or a backdrop.
  4. States add no shades: hover goes one step toward base-100. Active, selected and focus use accent. Disabled uses opacity.

In a theme, neighbouring base colors should differ by about 3% in lightness (OKLCH), otherwise buttons are hard to tell apart from the surface.

Theme editor ​

Change the variables of this panel. Copy the css from the bottom of the panel.