Customize

This topic describes how to style forms created with the Rebilly Cashier Javascript library.

Adjusting the theme

This process describes how to adjust the style of a form created with the Rebilly Cashier library.

1. Add a stylesheet

You can add your stylesheet externally by including a link to the stylesheet in the head of your HTML document, or internally by adding a style tag directly to your HTML file. To learn more about structuring your CSS, see How CSS is structured.

Use a dedicated stylesheet to style your form.

External stylesheet

To add an external stylesheet, include a link to the stylesheet in the <head> section of your HTML document. This keeps your styles separate from your HTML structure, making it easier to maintain and update your styles.

<!doctype html>
<html lang="en">
<head>
  <meta charset="UTF-8" />
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  <link rel="stylesheet" href="path/to/your/stylesheet.css">
</head>
  <body>
  </body>
</html>

Internal stylesheet

To add an internal stylesheet, include a <style> tag directly in your HTML file. This keeps your styles separate from your HTML structure, making it easier to maintain and update your styles.

<!doctype html>
<html lang="en">
  <style>
    /* Form styles */
  </style>
  <body>
  </body>
</html>

2. Use CSS to style your form

CSS variables

The Rebilly Cashier library uses CSS variables to define global form styles, such as background color, text color, and font size. Updating these variables simplifies branding adjustments.

When using CSS variables to override a Cashier library variable, ensure that both variables are defined in the same :root selector.

/* Use the root element to override the CSS variables */
:root {
  --my-primary-color: #0044d4;
  --replay-font-size: 14px;
  --replay-line-height: 20px;
  --replay-color-primary: var(--my-primary-color);
}

CSS selectors

You can also use CSS selectors to modify a specific component. For more information, see Advanced theming.

.rebilly-cashier-button {
  border-color: var(--my-button-color);
}

Theme

By making adjustments to the global variables, you can customize the appearance of the experience to align with your brand.

Use Replay tokens to control typography size and spacing in cashier forms by changing the --replay-font-size variable. This value automatically updates all related font sizes and spacing adjustments.

Global variables

Global variables

Commonly used global variables.

CSS variableDescriptionValues
--replay-color-primaryMain brand color used for primary buttons and accentsColor
--replay-backgroundMain background of the entire form containerBackground
--replay-surfaceBackground for elevated elements like inputs, selects, and cardsBackground
--replay-font-familyPrimary font family used throughout the formFont family
--replay-font-sizeBase font size for regular text contentFont size
--replay-font-colorPrimary text color for regular contentColor
--replay-font-color-mutedSubdued text color for secondary information and placeholdersColor
--replay-font-color-dangerText color for error messages and destructive actionsColor
--replay-font-color-infoText color for informational messages and neutral notificationsColor
--replay-font-color-successText color for success messages and positive confirmationsColor
--replay-font-color-warningText color for warning messages and cautionary informationColor
--replay-font-color-on-surfaceText color when displayed on surface backgrounds or containersColor
--replay-line-heightBase line height for improved text readabilityLine height
--replay-color-focusFocus outline color for keyboard navigation and accessibilityColor
--replay-border-colorDefault border color for form elements and containersColor
--replay-border-color-infoBorder color for informational states and notificationsColor
--replay-border-color-successBorder color for successful states and positive feedbackColor
--replay-border-color-dangerBorder color for error states and validation failuresColor
--replay-border-color-warningBorder color for warning states and cautionary messagesColor
--replay-border-widthStandard border thickness used throughout the formBorder width
--replay-border-radiusCorner rounding for form elements and containersBorder radius
--replay-icon-colorDefault color for icons and symbols throughout the formColor
--replay-cashier-section-gapSpacing between each section of the layoutLength
--replay-cashier-max-widthMaximum width constraint for the entire form layoutWidth
--replay-cashier-main-loader-sizeSize of the primary loading spinner displayed during processingWidth
--replay-selection-backgroundBackground color for selected textSelection background
--replay-selection-font-colorText color for selected textSelection color

Styling individual components

For more detailed control over each element, you can reassign values to refine your branding.

Tab

Tab variables

Commonly used variables for styling tabs.

CSS variableDescriptionValues
--replay-cashier-tabs-gapSpace between tabsLength
--replay-cashier-tab-font-familyFont family for tab textFont family
--replay-cashier-tab-backgroundDefault tab backgroundBackground
--replay-cashier-tab-background-hoverTab background when mouse hovers over itBackground
--replay-cashier-tab-font-colorDefault tab text colorColor
--replay-cashier-tab-font-color-hoverTab text color when mouse hovers over itColor
--replay-cashier-tab-font-weightFont weight for tab textFont weight
--replay-cashier-tab-font-sizeFont size for tab textFont size
--replay-cashier-tab-line-heightLine height for tab textLine height
--replay-cashier-tab-border-widthWidth of tab bordersBorder width
--replay-cashier-tab-border-styleStyle of tab bordersBorder style
--replay-cashier-tab-border-colorDefault tab border colorBorder color
--replay-cashier-tab-border-color-hoverTab border color when mouse hovers over itBorder color
--replay-cashier-tab-border-radiusBorder radius for rounded tab cornersBorder radius
--replay-cashier-tab-paddingInternal spacing within tabsPadding
--replay-cashier-tab-background-activeBackground for the currently active tabBackground
--replay-cashier-tab-background-active-hoverBackground for active tab when mouse hovers over itBackground
--replay-cashier-tab-font-color-activeText color for the currently active tabColor
--replay-cashier-tab-font-color-active-hoverText color for active tab when mouse hovers over itColor
--replay-cashier-tab-border-color-activeBorder color for the currently active tabBorder color
--replay-cashier-tab-border-color-active-hoverBorder color for active tab when mouse hovers over itBorder color

Button

Button variables

Commonly used variables for styling buttons.

CSS variableDescriptionValues
--replay-cashier-button-backgroundDefault button backgroundBackground
--replay-cashier-button-background-hoverButton background when mouse hovers over itBackground
--replay-cashier-button-background-activeButton background when clicked or pressedBackground
--replay-cashier-button-font-colorDefault button text colorColor
--replay-cashier-button-font-color-hoverButton text color when mouse hovers over itColor
--replay-cashier-button-font-color-activeButton text color when clicked or pressedColor
--replay-cashier-button-border-widthThickness of button bordersBorder width
--replay-cashier-button-border-styleStyle of button borders (solid, dashed, etc.)Border style
--replay-cashier-button-border-colorDefault button border colorBorder color
--replay-cashier-button-border-color-hoverButton border color when mouse hovers over itBorder color
--replay-cashier-button-border-color-activeButton border color when clicked or pressedBorder color
--replay-cashier-button-font-weightButton text thickness (normal, bold, etc.)Font weight
--replay-cashier-button-font-sizeSize of button textFont size
--replay-cashier-button-line-heightButton text line spacing for vertical centeringLine height
--replay-cashier-button-border-radiusCorner rounding for button edgesBorder radius
--replay-cashier-button-paddingInternal spacing around button textPadding
--replay-cashier-button-background-primaryBackground for primary action buttonsBackground
--replay-cashier-button-background-primary-hoverPrimary button background when hoveredBackground
--replay-cashier-button-background-primary-activePrimary button background when clicked or pressedBackground
--replay-cashier-button-font-color-primaryText color for primary action buttonsColor
--replay-cashier-button-font-color-primary-hoverPrimary button text color when hoveredColor
--replay-cashier-button-font-color-primary-activePrimary button text color when clicked or pressedColor
--replay-cashier-button-border-color-primaryBorder color for primary action buttonsBorder color
--replay-cashier-button-border-color-primary-hoverPrimary button border color when hoveredBorder color
--replay-cashier-button-border-color-primary-activePrimary button border color when clicked or pressedBorder color
--replay-cashier-button-background-dangerBackground for destructive action buttonsBackground
--replay-cashier-button-background-danger-hoverDanger button background when hoveredBackground
--replay-cashier-button-background-danger-activeDanger button background when clicked or pressedBackground
--replay-cashier-button-font-color-dangerText color for destructive action buttonsColor
--replay-cashier-button-font-color-danger-hoverDanger button text color when hoveredColor
--replay-cashier-button-font-color-danger-activeDanger button text color when clicked or pressedColor
--replay-cashier-button-border-color-dangerBorder color for destructive action buttonsBorder color
--replay-cashier-button-border-color-danger-hoverDanger button border color when hoveredBorder color
--replay-cashier-button-border-color-danger-activeDanger button border color when clicked or pressedBorder color
--replay-cashier-button-font-size-smText size for compact or small buttonsFont size
--replay-cashier-button-line-height-smLine spacing for compact button textLine height
--replay-cashier-button-padding-smReduced internal spacing for compact buttonsPadding

Button group

Button group variables
CSS variableDescriptionValues
--replay-cashier-button-group-gapSpacing between buttons when arranged in groupsLength

Input

Input variables

Commonly used variables for styling inputs.

CSS variableDescriptionValues
--replay-cashier-input-label-font-colorText color for input field labelsColor
--replay-cashier-input-label-font-sizeFont size for input field labelsFont size
--replay-cashier-input-label-line-heightLine spacing for input field labelsLine height
--replay-cashier-input-label-font-weightFont weight for input field labelsFont weight
--replay-cashier-input-placeholder-font-colorColor of placeholder text shown when input is emptyColor
--replay-cashier-input-font-colorColor of text entered into input fieldsColor
--replay-cashier-input-font-sizeFont size for text entered into input fieldsFont size
--replay-cashier-input-line-heightLine spacing for text entered into input fieldsLine height
--replay-cashier-input-font-weightFont weight for text entered into input fieldsFont weight
--replay-cashier-input-backgroundDefault background for input fieldsBackground
--replay-cashier-input-background-disabledBackground when input field is disabledBackground
--replay-cashier-input-background-hoverBackground when mouse hovers over input fieldBackground
--replay-cashier-input-background-focusBackground when input field has keyboard focusBackground
--replay-cashier-input-border-widthDefault border thickness for input fieldsBorder width
--replay-cashier-input-border-focus-widthBorder thickness when input field has keyboard focusBorder width
--replay-cashier-input-border-styleBorder style for input fields (solid, dashed, etc.)Border style
--replay-cashier-input-border-colorDefault border color for input fieldsBorder color
--replay-cashier-input-border-color-hoverBorder color when mouse hovers over input fieldBorder color
--replay-cashier-input-border-color-focusBorder color when input field has keyboard focusBorder color
--replay-cashier-input-border-color-dangerBorder color when input field has validation errorsBorder color
--replay-cashier-input-border-radiusCorner rounding for input field edgesBorder radius
--replay-cashier-input-paddingInternal spacing around text within input fieldsPadding
--replay-cashier-input-help-font-sizeFont size for helpful descriptive text below inputsFont size
--replay-cashier-input-help-line-heightLine spacing for helpful descriptive text below inputsLine height
--replay-cashier-input-help-font-weightFont weight for helpful descriptive text below inputsFont weight
--replay-cashier-input-help-font-colorText color for helpful descriptive text below inputsColor
--replay-cashier-input-validation-font-sizeFont size for error messages displayed below inputsFont size
--replay-cashier-input-validation-font-colorText color for error messages displayed below inputsColor
--replay-cashier-input-validation-font-weightFont weight for error messages displayed below inputsFont weight
--replay-cashier-input-validation-line-heightLine spacing for error messages displayed below inputsLine height
--replay-cashier-input-selection-backgroundInputs background color for selected textSelection background
--replay-cashier-input-selection-font-colorInputs text color for selected textSelection color

Select

Select variables

Commonly used variables for styling inputs.

CSS variableDescriptionValues
--replay-cashier-select-label-font-colorText color for dropdown field labelsColor
--replay-cashier-select-label-font-sizeFont size for dropdown field labelsFont size
--replay-cashier-select-label-line-heightLine spacing for dropdown field labelsLine height
--replay-cashier-select-label-font-weightFont weight for dropdown field labelsFont weight
--replay-cashier-select-font-sizeFont size for selected option text in dropdownFont size
--replay-cashier-select-font-colorText color for selected option text in dropdownColor
--replay-cashier-select-line-heightLine spacing for selected option text in dropdownLine height
--replay-cashier-select-font-weightFont weight for selected option text in dropdownFont weight
--replay-cashier-select-paddingInternal spacing around dropdown button contentPadding
--replay-cashier-select-backgroundDefault background for dropdown buttonBackground
--replay-cashier-select-background-disabledBackground when dropdown is disabledBackground
--replay-cashier-select-border-widthBorder thickness for dropdown buttonBorder width
--replay-cashier-select-border-styleBorder style for dropdown button (solid, dashed, etc.)Border style
--replay-cashier-select-border-colorDefault border color for dropdown buttonBorder color
--replay-cashier-select-border-radiusCorner rounding for dropdown button edgesBorder radius
--replay-cashier-select-background-focusBackground when dropdown has keyboard focusBackground
--replay-cashier-select-border-color-focusBorder color when dropdown has keyboard focusBorder color
--replay-cashier-select-border-width-focusBorder thickness when dropdown has keyboard focusBorder width

Checkbox

Checkbox variables

Commonly used variables for styling checkboxes.

CSS variableDescriptionValues
--replay-cashier-checkbox-sizeWidth and height dimensions of the checkbox squareSize (width & height)
--replay-cashier-checkbox-border-radiusCorner rounding for checkbox edgesBorder radius
--replay-cashier-checkbox-border-colorBorder color for unchecked checkboxBorder color
--replay-cashier-checkbox-border-widthBorder thickness for checkbox squareBorder width
--replay-cashier-checkbox-backgroundBackground for unchecked checkboxBackground
--replay-cashier-checkbox-label-font-sizeFont size for checkbox label textFont size
--replay-cashier-checkbox-label-font-colorText color for checkbox labelColor
--replay-cashier-checkbox-label-line-heightLine spacing for checkbox label textLine height
--replay-cashier-checkbox-label-font-weightFont weight for checkbox label textFont weight
--replay-cashier-checkbox-checked-backgroundBackground when checkbox is checkedBackground
--replay-cashier-checkbox-checked-border-colorBorder color when checkbox is checkedBorder color
--replay-cashier-checkbox-checked-border-widthBorder thickness when checkbox is checkedBorder width
--replay-cashier-checkbox-checked-icon-colorColor of the checkmark symbol inside checked checkboxColor
--replay-cashier-checkbox-checked-icon-sizeSize of the checkmark symbol inside checked checkboxSize
--replay-cashier-checkbox-checked-icon-border-widthStroke width of the checkmark symbol linesBorder width
--replay-cashier-checkbox-help-font-sizeFont size for helpful text below checkboxFont size
--replay-cashier-checkbox-help-line-heightLine spacing for helpful text below checkboxLine height
--replay-cashier-checkbox-help-font-colorText color for helpful text below checkboxColor

Payment method item

Payment method item variables

Commonly used variables for styling the payment method item.

CSS variableDescriptionValues
--replay-cashier-payment-method-item-paddingInternal spacing around payment method option contentPadding
--replay-cashier-payment-method-item-gapSpacing between payment method option cardsLength
--replay-cashier-payment-method-item-border-colorBorder color for payment method option cardsBorder color
--replay-cashier-payment-method-item-border-widthBorder thickness for payment method option cardsBorder width
--replay-cashier-payment-method-item-border-radiusCorner rounding for payment method option cardsBorder radius
--replay-cashier-payment-method-item-border-color-hoverBorder color when hovering over payment method optionBorder color
--replay-cashier-payment-method-item-backgroundBackground for payment method option cardsBackground
--replay-cashier-payment-method-item-background-hoverBackground when hovering over payment method optionBackground
--replay-cashier-payment-method-item-label-font-sizeFont size for payment method option labelsFont size
--replay-cashier-payment-method-item-label-line-heightLine spacing for payment method option labelsLine height
--replay-cashier-payment-method-item-label-font-weightFont weight for payment method option labelsFont weight
--replay-cashier-payment-method-item-label-font-colorText color for payment method option labelsColor
--replay-cashier-payment-method-item-label-font-color-hoverText color when hovering the payment method option labelsColor
--replay-cashier-payment-method-item-label-font-color-smallText color for payment method descriptions, or caption textColor
--replay-cashier-payment-method-item-label-font-size-smallFont size for payment method descriptions, or caption textFont size
--replay-cashier-payment-method-item-label-line-height-smallLine spacing for payment method descriptions, or caption textLine height
--replay-cashier-payment-method-item-label-font-weight-smallFont weight for payment method descriptions, or caption textFont weight
Payment method logo variables

Commonly used variables for styling the payment method logo.

CSS variableDescriptionValues
--replay-cashier-payment-method-logo-border-colorBorder color for payment provider logo containersBorder color
--replay-cashier-payment-method-logo-widthWidth of individual payment provider logosWidth
--replay-cashier-payment-method-logo-heightHeight of individual payment provider logosHeight
--replay-cashier-payment-method-logo-border-radiusCorner rounding for payment provider logo containersBorder radius
--replay-cashier-payment-method-logos-gapSpacing between payment provider logos in a groupLength

Reverse withdrawal

This component extends the payment method item functionality and inherits several CSS variables from the base payment method item component.

Badge variables
CSS variableDescriptionValues
--replay-cashier-reverse-withdraw-backgroundBackground color for reverse withdrawal componentBackground color
--replay-cashier-reverse-withdraw-label-font-sizeFont size for reverse withdrawal textFont size
--replay-cashier-reverse-withdraw-label-font-weightFont weight for reverse withdrawal textFont weight
--replay-cashier-reverse-withdraw-label-line-heightLine height for reverse withdrawal textLine height
--replay-cashier-reverse-withdraw-label-font-colorText color for reverse withdrawal componentColor
--replay-cashier-reverse-withdraw-border-colorBorder color for reverse withdrawal componentBorder color
--replay-cashier-reverse-withdraw-border-widthBorder width for reverse withdrawal componentBorder width
--replay-cashier-reverse-withdraw-border-radiusBorder radius for reverse withdrawal componentBorder radius
--replay-cashier-reverse-withdraw-help-font-sizeFont size for reverse withdrawal help textFont size
--replay-cashier-reverse-withdraw-help-font-weightFont weight for reverse withdrawal help textFont weight
--replay-cashier-reverse-withdraw-help-line-heightLine height for reverse withdrawal help textLine height
--replay-cashier-reverse-withdraw-help-font-colorText color for reverse withdrawal helpColor
--replay-cashier-reverse-withdraw-icon-backgroundBackground color for reverse withdrawal iconBackground color
--replay-cashier-reverse-withdraw-icon-border-colorBorder color for reverse withdrawal iconBorder color
--replay-cashier-reverse-withdraw-icon-colorColor for reverse withdrawal iconColor
--replay-cashier-reverse-withdraw-divider-marginMargin spacing for reverse withdrawal dividerMargin
--replay-cashier-reverse-withdraw-background-hoverBackground color for reverse withdrawal component on hoverBackground color
--replay-cashier-reverse-withdraw-border-color-hoverBorder color for reverse withdrawal component on hoverBorder color
--replay-cashier-reverse-withdraw-label-font-color-hoverText color for reverse withdrawal component on hoverColor
--replay-cashier-reverse-withdraw-help-font-color-hoverText color for reverse withdrawal help on hoverColor
--replay-cashier-reverse-withdraw-icon-color-hoverColor for reverse withdrawal icon on hoverColor
--replay-cashier-reverse-withdraw-icon-border-color-hoverBorder color for reverse withdrawal icon on hoverBorder color
--replay-cashier-reverse-withdraw-icon-background-hoverBackground color for reverse withdrawal icon on hoverBackground color
--replay-cashier-reverse-withdraw-background-activeBackground color for reverse withdrawal component when activeBackground color
--replay-cashier-reverse-withdraw-border-color-activeBorder color for reverse withdrawal component when activeBorder color
--replay-cashier-reverse-withdraw-label-font-color-activeText color for reverse withdrawal component when activeColor
--replay-cashier-reverse-withdraw-help-font-color-activeText color for reverse withdrawal help when activeColor
--replay-cashier-reverse-withdraw-icon-color-activeColor for reverse withdrawal icon when activeColor
--replay-cashier-reverse-withdraw-icon-border-color-activeBorder color for reverse withdrawal icon when activeBorder color
--replay-cashier-reverse-withdraw-icon-background-activeBackground color for reverse withdrawal icon when activeBackground color

Balance

Badge variables

Commonly used variables for styling the balance.

CSS variableDescriptionValues
--replay-cashier-balance-border-colorBorder color for balance componentBorder color
--replay-cashier-balance-border-radiusBorder radius for balance componentBorder radius
--replay-cashier-balance-border-widthBorder width for balance componentBorder width
--replay-cashier-balance-title-font-sizeFont size for main balance amountFont size
--replay-cashier-balance-title-font-colorText color for main balance amountColor
--replay-cashier-balance-title-font-weightFont weight for main balance amountFont weight
--replay-cashier-balance-title-line-heightLine height for main balance amountLine height
--replay-cashier-balance-subtitle-font-sizeFont size for balance subtitle textFont size
--replay-cashier-balance-subtitle-font-colorText color for balance subtitle textColor
--replay-cashier-balance-subtitle-line-heightLine height for balance subtitle textLine height
--replay-cashier-balance-subtitle-font-weightFont weight for balance subtitle textFont weight
--replay-cashier-balance-row-font-sizeFont size for balance breakdown labelsFont size
--replay-cashier-balance-row-font-colorText color for balance breakdown labelsColor
--replay-cashier-balance-row-font-weightFont weight for balance breakdown labelsFont weight
--replay-cashier-balance-row-line-heightLine height for balance breakdown labelsLine height
--replay-cashier-balance-row-amount-font-sizeFont size for balance breakdown amountsFont size
--replay-cashier-balance-row-amount-font-colorText color for balance breakdown amountsColor
--replay-cashier-balance-row-amount-font-weightFont weight for balance breakdown amountsFont weight
--replay-cashier-balance-row-amount-line-heightLine height for balance breakdown amountsLine height

Badge

Badge variables

Commonly used variables for styling the badge.

CSS variableDescriptionValues
--replay-cashier-badge-backgroundDefault background for status badgesBackground
--replay-cashier-badge-font-colorDefault text color for status badgesColor
--replay-cashier-badge-border-colorDefault border color for status badgesBorder color
--replay-cashier-badge-border-widthBorder thickness for status badgesBorder width
--replay-cashier-badge-border-styleBorder style for status badges (solid, dashed, etc.)Border style
--replay-cashier-badge-border-radiusCorner rounding for status badge edgesBorder radius
--replay-cashier-badge-paddingInternal spacing around badge textPadding
--replay-cashier-badge-font-sizeFont size for status badge textFont size
--replay-cashier-badge-font-weightFont weight for status badge textFont weight
--replay-cashier-badge-line-heightLine spacing for status badge textLine height
--replay-cashier-badge-font-familyFont family for status badge textFont family
--replay-cashier-badge-border-color-infoBorder color for informational status badgesBorder color
--replay-cashier-badge-background-infoBackground for informational status badgesBackground
--replay-cashier-badge-font-color-infoText color for informational status badgesColor
--replay-cashier-badge-border-color-successBorder color for success status badgesBorder color
--replay-cashier-badge-background-successBackground for success status badgesBackground
--replay-cashier-badge-font-color-successText color for success status badgesColor
--replay-cashier-badge-border-color-warningBorder color for warning status badgesBorder color
--replay-cashier-badge-background-warningBackground for warning status badgesBackground
--replay-cashier-badge-font-color-warningText color for warning status badgesColor
--replay-cashier-badge-border-color-dangerBorder color for error/danger status badgesBorder color
--replay-cashier-badge-background-dangerBackground for error/danger status badgesBackground
--replay-cashier-badge-font-color-dangerText color for error/danger status badgesColor

Title

Title variables
CSS variableDescriptionValues
--replay-cashier-title-font-colorText color for form section headings and titlesColor
--replay-cashier-title-gapSpacing between title elements when groupedLength
--replay-cashier-title-h1-margin-bottomBottom spacing for primary form headings (H1)Margin
--replay-cashier-title-h2-margin-bottomBottom spacing for secondary form headings (H2)Margin

Result

Result variables
CSS variableDescriptionValues
--replay-cashier-result-title-font-colorText color for result page headingsColor
--replay-cashier-result-title-font-sizeFont size for result page headingsFont size
--replay-cashier-result-title-line-heightLine spacing for result page headingsLine height
--replay-cashier-result-title-font-weightFont weight for result page headingsFont weight
--replay-cashier-result-font-colorText color for result page contentColor
--replay-cashier-result-font-sizeFont size for result page contentFont size
--replay-cashier-result-line-heightLine spacing for result page contentLine height
--replay-cashier-result-font-weightFont weight for result page contentFont weight
--replay-cashier-result-icon-gapSpacing between icons on result pagesLength
--replay-cashier-result-button-gapSpacing between action buttons on result pagesLength
--replay-cashier-result-billing-descriptor-font-colorText color for result page billing descriptorColor
--replay-cashier-result-billing-descriptor-font-sizeFont size for result page billing descriptorFont size
--replay-cashier-result-billing-descriptor-line-heightLine spacing for result page billing descriptorLine height
--replay-cashier-result-billing-descriptor-font-weightFont weight for result page billing descriptorFont weight

Alert

Alert variables

Commonly used variables for styling alerts.

CSS variableDescriptionValues
--replay-cashier-alert-paddingInternal spacing around alert contentPadding
--replay-cashier-alert-border-widthBorder thickness for alert containersBorder width
--replay-cashier-alert-border-radiusCorner rounding for alert container edgesBorder radius
--replay-cashier-alert-border-colorDefault border color for alert containersBorder color
--replay-cashier-alert-content-font-sizeFont size for alert message textFont size
--replay-cashier-alert-content-line-heightLine spacing for alert message textLine height
--replay-cashier-alert-border-color-dangerBorder color for error/danger alert containersBorder color
--replay-cashier-alert-border-color-successBorder color for success alert containersBorder color
--replay-cashier-alert-border-color-infoBorder color for informational alert containersBorder color
--replay-cashier-alert-border-color-warningBorder color for warning alert containersBorder color
--replay-cashier-alert-background-dangerBackground for error/danger alert containersBackground
--replay-cashier-alert-background-successBackground for success alert containersBackground
--replay-cashier-alert-background-infoBackground for informational alert containersBackground
--replay-cashier-alert-background-warningBackground for warning alert containersBackground
--replay-cashier-alert-content-font-color-dangerText color for error/danger alert contentColor
--replay-cashier-alert-content-font-color-successText color for success alert contentColor
--replay-cashier-alert-content-font-color-warningText color for warning alert contentColor
--replay-cashier-alert-content-font-color-infoText color for informational alert contentColor
--replay-cashier-alert-title-font-color-dangerText color for error/danger alert titlesColor
--replay-cashier-alert-title-font-color-successText color for success alert titlesColor
--replay-cashier-alert-title-font-color-warningText color for warning alert titlesColor
--replay-cashier-alert-title-font-color-infoText color for informational alert titlesColor

Advanced theming

To further customize the appearance of the app, you can target specific CSS selectors within the form. For instance, you can modify the styling of input elements by using the .rebilly-cashier-input CSS selector, as demonstrated in the example below:

.rebilly-cashier-input {
  color: blue;
}

.rebilly-cashier-input:hover .rebilly-cashier-input-field:hover {
  background: green;
}

.rebilly-cashier-button[disabled] {
  opacity: 0.6;
}

Replay tokens are used throughout the application, including in the cashier. If you set a global token (one without the --replay prefix), it will affect every component that uses that token. To limit your changes to just the cashier component, scope your CSS variable to the cashier only, like this:

rebilly-cashier {
  /* Only the cashier component will use this value */
  --replay-font-size: 14px;
}

This approach overrides the token for the cashier, while leaving other parts of your app unaffected.

Using the browser inspector

To identify the CSS selector for an element you want to modify, use the inspector tool in your web browser. Right-click on the element and choose "Inspect" from the context menu. This action will launch the developer tools in the browser and highlight the corresponding HTML element. You can then use this selector in your custom styles to alter the appearance of the element.

Commonly used selectors

To ensure a consistent and unified appearance, it is crucial to style related components when using selectors for theming. This practice helps maintain a cohesive look and prevents discrepancies in the presentation of the form.

Element DescriptionSelector
Deposit formDeposit form element.rebilly-cashier-deposit-form
Amount selectorDisplays the available deposit amounts.rebilly-cashier-amount-select .rebilly-cashier-amount-select-input-wrapper
Payment method selectorList of saved and available methods.rebilly-cashier-payment-method-select .rebilly-cashier-choose-payment-methods
ButtonButton selectors includes default and primary.rebilly-cashier-button .rebilly-cashier-button-primary
Button groupList of buttons display in rows or columns.rebilly-cashier-button-group
InputSelectors for input elements, including labels, and fields.rebilly-cashier-input .rebilly-cashier-input-label .rebilly-cashier-input-field
SelectSelectors for select elements, including labels, and fields.rebilly-cashier-select .rebilly-cashier-select-label .rebilly-cashier-select-field
Payment method itemDisplay payment method information.rebilly-cashier-payment-method-item .rebilly-cashier-payment-method-item-label
Payment method logoPayment method logo container.rebilly-cashier-payment-method-logos .rebilly-cashier-payment-method-logo
TitleTitle headings.rebilly-cashier-title
IconsSelectors related to SVG icons.rebilly-cashier-icon .rebilly-cashier-icon.rebilly-cashier-icon-color

Modifiers

Modifier styles in CSS are used to apply additional styling to specific states of a component.

ModifierDescriptionSelector
.rebilly-cashier-is-disabledDisable state.rebilly-cashier-payment-method-item
.rebilly-cashier-is-loadingLoading state.rebilly-deposit-form .rebilly-cashier-payment-method-item