Appearance API
Shared between Watenga.js and Elements.
Variables
| Variable | Type | Description |
|---|---|---|
| colorPrimary | string | Primary brand color |
| colorBackground | string | Input background |
| colorText | string | Primary text color |
| colorDanger | string | Error state color |
| fontFamily | string | Font stack |
| spacingUnit | string | Base spacing (e.g. 4px) |
| borderRadius | string | Corner 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' },
},
}