Skip to content

Theming

The modal is the only UI surface the SDK renders, and every visual aspect of it is controlled via CSS custom properties. The modal uses Shadow DOM — your page CSS won’t leak in, and its styles won’t affect your page.

The idiomatic path is the theme option on the THGVTO constructor — it maps directly to CSS custom properties on the modal:

new THGVTO({
theme: {
primaryColor: '#1a1a2e',
primaryTextColor: '#ffffff',
buttonRadius: '24px',
fontFamily: 'Helvetica Neue, sans-serif',
modalMaxWidth: '900px',
},
});

You can also set the CSS custom properties directly on vto-modal if you need finer-grained control:

vto-modal {
--vto-primary-color: #1a1a2e;
--vto-primary-text-color: #ffffff;
--vto-button-radius: 24px;
--vto-font-family: 'Helvetica Neue', sans-serif;
}
PropertyDefaultDescription
--vto-primary-color#000Primary action colour (buttons, selected states)
--vto-primary-text-color#fffText colour on primary backgrounds
--vto-button-radius4pxButton border radius
--vto-modal-border-radius12pxModal corner radius
--vto-font-familyinheritFont family (inherits from host page)
--vto-modal-max-width480pxMaximum modal width
PropertyDefaultDescription
--vto-warning-color#d97706Warning accent
--vto-warning-bg-color#fffbebWarning background
--vto-warning-border-color#fde68aWarning border
--vto-warning-text-color#92400eWarning text

The SDK no longer renders a button — you own the trigger and style it however you like. The theme option controls the modal only.

new THGVTO({
theme: {
primaryColor: '#1a1a1a',
buttonRadius: '0',
fontFamily: 'Playfair Display, serif',
},
});