Visual Customization

CSS color properties the legacy Card Enrollment SDK's setStyle accepts for buttons, inputs, checkboxes, links and overlays, with defaults and an example.

For: developers

📘

Legacy Card Enrollment SDK

This page is for pages already on the legacy Card Enrollment SDK. A new integration starts on the Unified Enrollment SDK v2: SDK v2: Quick Start.

Visual Customization

The legacy Card Enrollment SDK supports visual customization through CSS custom properties. You can adjust colors for buttons, inputs, checkboxes, links, and overlays to match your brand.

Customization is applied using the CardEnrollmentSdk.setStyle() method, which is called independently from openForm.

Available Properties

CSS Custom PropertyDefaultDescription
--btn-primary-bg-color#000Primary button background color (e.g. Submit, Continue, Save)
--checkbox-bg-color--checked#000Checkbox background color when selected
--input-color#767676Text color inside form input fields
--input-border-color#e6e8ebInput field border color in its normal state
--input-border-color--error#f04437Input field border color when there is a validation error
--terms-link-color#000Color of Terms & Conditions and Privacy Policy links
--overlay-bg-colorrgba(81,96,120,0.75)Background color of screen overlays (modals, pop-ups, dimmed backgrounds)

Usage

Call CardEnrollmentSdk.setStyle() with a colors object containing the properties you want to override. You only need to include the properties you want to change. All others will use their defaults. In TypeScript, import the SdkStyle type from @astrada.co/card-enrollment-sdk (see Installation) for the argument shape.

CardEnrollmentSdk.setStyle({
  colors: {
    '--btn-primary-bg-color': '#6200ee',
    '--checkbox-bg-color--checked': '#6200ee',
    '--input-border-color': '#cccccc',
    '--overlay-bg-color': 'rgba(0, 0, 0, 0.5)',
  }
});

setStyle should be called after openForm. The styles are applied automatically once the SDK loads. For example:

// Initiates card enrollment UI
CardEnrollmentSdk.openForm({
  companyName: "Your company name",
  subaccountId: "67bc3887-4e25-49cf-bea7-326d808acb5f",
  getAccessToken: async () => 'valid-json-web-token',
  onSuccess: (data) => console.log(data),
  onError: (data) => console.log(data),
  onCancel: () => console.log("The user abandoned the enrollment flow."),
});

// Apply custom styles
CardEnrollmentSdk.setStyle({
  colors: {
    '--btn-primary-bg-color': '#1a73e8',
    '--terms-link-color': '#1a73e8',
  }
});

All color values must be valid CSS color strings (hex, rgb(), rgba(), or named colors). Only the properties listed above are supported. Any other CSS variables will be ignored.

📘

These are the only visual customizations currently available. The SDK does not support custom fonts, layouts, or additional component styling. Styling changes the consent boxes' checkbox and link colours only; it cannot hide them. When each box shows: The consent record. For the customer terms text, see Configuration.

Two Card Enrollment SDK forms side by side, both boxes ticked: default black, and with setStyle blue button, checkboxes and links.

Styling changes colours; both boxes stay.


Did this page help you?