styles attribute. Pass a JSON string of design tokens to customize colors, typography, border radius, and more — no widget redeployment needed.
Quick Start
Set a few brand tokens to theme any widget:styles attribute follows the same pattern as custom-labels — a JSON string on the HTML element.
How It Works
The widget parses the JSON, resolves tokens against built-in defaults, and applies them as CSS custom properties (--gizmo-*) at runtime. Tokens propagate through the widget’s Shadow DOM and are securely bridged into PCI-compliant iframes via URL parameters at creation time.
Interaction with theme
The theme attribute ("default" or "night-shift") sets a base preset. The styles attribute overrides individual tokens on top of it. If both are set, styles values take precedence per-token.
Token Reference
Tokens are organized into two tiers. Tier 1 (semantic tokens) are the primary styling API — setting 5–6 of these gives you a fully branded widget. Tier 2 (component overrides) provide fine-grained control over individual elements, defaulting to their Tier 1 counterparts when not set.Tier 1 — Semantic Tokens
Tier 2 — Component Overrides
These are optional. When not set, they inherit from Tier 1 tokens.Reveal Card Tokens
These apply only to the Reveal Card Widget.Examples
Brand Colors Only
The simplest approach — set your primary color and font:Full Customization
Override both semantic tokens and component-level tokens:Reveal Card with Custom Card Face
Dark Theme with Overrides
Start from the built-innight-shift preset, then override individual tokens:
Built-in Theme Presets
default
Light background with blue accents. This is used when theme is not set or set to "default".
night-shift
Dark background with purple accents. Apply with theme="night-shift":
Notes
- Unknown token keys are ignored. If you pass a key that doesn’t match a known token, it’s silently dropped.
- Invalid JSON falls back to defaults. A malformed
stylesstring logs a console warning and applies no overrides. - Token values are CSS values. Colors accept any CSS color format (
#hex,rgb(),hsl(), named colors). Sizes acceptpx,rem,em, etc.cardBackgroundsupports gradient strings. - Tokens apply at widget initialization. To change tokens after mount, update the
stylesattribute and the widget will re-apply.

