Skip to main content

Theming & Copy

The designer modal is fully themeable. Pass a theme object to Treatink.init and every value is stamped onto the modal root as a --tk-* CSS custom property; pass copy to override any user-visible string.

Treatink.init({
apiKey: 'pk_test_quickstart',
channel: 'petshop.example.com',
theme: { primary: '#8EA0F6', accent: '#EA8D00', borderRadius: '15px' },
copy: { headerTitle: 'Personalize Your Product', saveButton: 'Save Customization' },
});

Theme tokens

Every ThemeConfig key, its CSS variable, and its default (the exact Treatink store palette):

KeyCSS variableDefaultUsed for
primary--tk-primary#a99cdfprimary UI color (purple)
primaryStrong--tk-primary-strong#8c7ec2stronger primary (hover, emphasis)
panelBackground--tk-panel#e2e6ffcontrol panels
accent--tk-accent#ffa518call-to-action accents (orange)
accentHover--tk-accent-hover#dd9133accent hover state
headerBackground--tk-header-background#F26B1Dmodal header chrome
headerText--tk-header-text#ffffffmodal header text
surface--tk-surface#ffffffcard/dialog surfaces
surfaceAlt--tk-surface-alt#F6F6FCalternate surfaces
borderRadius--tk-border-radius20pxcards
buttonRadius--tk-radius-button15pxfilled buttons
controlRadius--tk-radius-control10pxchips, thumbnails, inputs
fontFamily--tk-font-family'Montserrat', system-ui, sans-serifall modal text
overlayColor--tk-overlay-colorrgba(0, 0, 0, 0.55)backdrop
zIndex--tk-z-index2147483000overlay stacking
logofalseoptional logo image URL for the header

Derived tokens — override less, stay coherent

You rarely need to set more than primary, accent, and borderRadius. Derived tokens resolve explicit-wins: a token you set is used verbatim; a derived token you omit whose base you did override is computed from your base in the browser, so the palette stays coherent:

Derived tokenBaseDerivation
primaryStrongprimarycolor-mix(in srgb, <primary> 80%, #000000)
panelBackgroundprimarycolor-mix(in srgb, <primary> 20%, #ffffff)
surfaceAltprimarycolor-mix(in srgb, <primary> 6%, #ffffff)
accentHoveraccentcolor-mix(in srgb, <accent> 88%, #000000)
buttonRadiusborderRadiusmin(<borderRadius>, 15px)
controlRadiusborderRadiusmin(<borderRadius>, 10px)

Tokens you leave completely untouched keep the store defaults from the table above.

Variables are set on the overlay root element, so your page's CSS can still out-cascade them if you need surgical overrides — all modal classes are tk--prefixed.

Copy overrides

Every user-visible string in the modal has a key in copy (see CopyStrings for the full list). Pass only the keys you want to change:

copy: {
headerTitle: 'Personalize Your Product',
saveButton: 'Save Customization',
}

Fonts

The modal's default typeface is Montserrat, bundled with the SDK — it is never fetched from a third-party font CDN (see Security & privacy). Set fontFamily to use your storefront's own font stack instead.