Customize look and feel

Customize the visual appearance of the Onerway Web SDK checkout using built-in themes, CSS variables, custom stylesheets, and fine-grained style overrides.

Onerway Web SDK provides multiple ways to customize the checkout appearance to match your brand.

MethodBest forComplexity
Built-in themesQuickly switch between preset stylesLow
CSS variablesAdjust global design tokens like colors and fontsLow–Medium
Custom stylesheetInject an external CSS file to override stylesMedium
Fine-grained style overridesPrecisely control specific UI elementsHigh
All style customizations take effect only at SDK initialization. Dynamic changes at runtime are not reflected in the checkout UI.

Built-in themes

The SDK ships with several preset themes. Use the checkoutTheme parameter to switch the overall style quickly.

const pacypay = new Pacypay(transactionId, {
  container: 'onerway_checkout',
  locale: 'en',
  environment: 'sandbox',
  mode: 'CARD',
  redirectUrl: redirectUrlFromServer,
  config: {
    checkoutTheme: 'dark'
  }
})
checkoutTheme is ignored in the following cases:
  • customCssURL is also provided
  • cssVariables is also provided
To use a built-in theme, make sure neither of those parameters is passed.

Supported theme values: default (light, default), dark.

CSS variables

Pass design tokens through the cssVariables parameter to override global visual properties without writing an external stylesheet.

const pacypay = new Pacypay(transactionId, {
  container: 'onerway_checkout',
  locale: 'en',
  environment: 'sandbox',
  mode: 'CARD',
  redirectUrl: redirectUrlFromServer,
  config: {
    cssVariables: {
      '--primary-color': '#6750A4',
      '--background-color': '#FFFBFE',
      '--text-color': '#1C1B1F',
      '--border-color': '#CAC4D0',
      '--border-radius': '12px',
      '--font-family': 'Roboto, sans-serif',
      '--font-size': '16px'
    }
  }
})

Available CSS variables

VariableDescriptionExample value
--primary-colorPrimary color (buttons, highlights, etc.)#6750A4
--background-colorCheckout background color#FFFBFE
--text-colorPrimary text color#1C1B1F
--border-colorInput field and divider border color#CAC4D0
--border-radiusGlobal border radius12px
--font-familyFont familyRoboto, sans-serif
--font-sizeBase font size16px

Custom stylesheet

Pass an external CSS file URL via customCssURL. The SDK injects the stylesheet when the checkout loads.

const pacypay = new Pacypay(transactionId, {
  container: 'onerway_checkout',
  locale: 'en',
  environment: 'sandbox',
  mode: 'CARD',
  redirectUrl: redirectUrlFromServer,
  config: {
    customCssURL: 'https://merchant.example.com/checkout-theme.css'
  }
})
When using customCssURL:
  • The stylesheet must be served over HTTPS, and the server must include the correct CORS headers to allow cross-origin loading from the SDK domain.
  • When customCssURL is provided, both checkoutTheme and cssVariables are ignored.
  • Prefer overriding CSS variables in your stylesheet rather than targeting internal selectors directly, to reduce compatibility risk across SDK upgrades.

Fine-grained style overrides

When CSS variables and custom stylesheets are not enough, use styleOverrides to pass precise style rules for specific UI elements.

const pacypay = new Pacypay(transactionId, {
  container: 'onerway_checkout',
  locale: 'en',
  environment: 'sandbox',
  mode: 'CARD',
  redirectUrl: redirectUrlFromServer,
  config: {
    styleOverrides: {
      '.checkout-submit-btn': {
        'background-color': '#6750A4',
        'border-radius': '8px',
        'font-weight': '600'
      },
      '.checkout-input-field': {
        'border-color': '#CAC4D0',
        'border-radius': '4px'
      }
    }
  }
})
CSS class names in styleOverrides are tied to the SDK's internal implementation and may change across SDK versions. Run regression tests before upgrading.

Available CSS classes

CSS classDescription
.checkout-containerOverall checkout container
.checkout-headerTop header area
.checkout-logoMerchant logo area
.checkout-formPayment form container
.checkout-input-fieldInput fields (card number, expiry, etc.)
.checkout-input-labelInput field label text
.checkout-input-errorInput field error message text
.checkout-select-fieldDropdown select field
.checkout-submit-btnSubmit / pay button
.checkout-submit-btn:hoverSubmit button hover state
.checkout-submit-btn:disabledSubmit button disabled state
.checkout-cancel-btnCancel button
.checkout-amount-displayAmount display area
.checkout-currency-symbolCurrency symbol
.checkout-order-summaryOrder summary area
.checkout-dividerDivider line
.checkout-footerFooter area (security badges, etc.)
.checkout-loading-overlayLoading overlay
.checkout-error-bannerGlobal error notification banner

Combining options

You can combine multiple customization methods. Priority order: styleOverrides > customCssURL > cssVariables. When customCssURL is provided, checkoutTheme and cssVariables are ignored.

const pacypay = new Pacypay(transactionId, {
  container: 'onerway_checkout',
  locale: 'en',
  environment: 'sandbox',
  mode: 'CARD',
  redirectUrl: redirectUrlFromServer,
  config: {
    // Set global design tokens with CSS variables
    cssVariables: {
      '--primary-color': '#6750A4',
      '--border-radius': '12px',
      '--font-family': 'Roboto, sans-serif'
    },
    // Fine-tune specific elements with style overrides
    styleOverrides: {
      '.checkout-submit-btn': {
        'font-weight': '700',
        'letter-spacing': '0.5px'
      }
    }
  }
})