Appearance API

Shared between Watenga.js and Elements.

Variables

VariableTypeDescription
colorPrimarystringPrimary brand color
colorBackgroundstringInput background
colorTextstringPrimary text color
colorDangerstringError state color
fontFamilystringFont stack
spacingUnitstringBase spacing (e.g. 4px)
borderRadiusstringCorner radius for inputs and tabs

Rules

Map CSS selectors to style objects. XSS-prone values (url(), expression()) are rejected.

javascript
appearance: {
  rules: {
    '.Input': { borderRadius: '8px', border: '1px solid #e2e8f0' },
    '.Input--invalid': { borderColor: '#dc2626' },
    '.Label': { fontWeight: '500' },
  },
}