Change the size and color of the close button

The close button of an upsell popup takes its color from the Text color. Use custom CSS to change its size or color, also only on mobile.

On this page

How the close button looks

Each upsell popup has a close button (×) in its top-right corner. It looks the same on mobile and on desktop:

  • The icon is 16 px. The tap area around it is 32 × 32 px.
  • The icon color is a mix of the Text color and the Background color of the popup. When a shopper points at the button or taps it, the icon takes the Text color.

There is no setting for the close button only. To change its color with a setting, change the Text color in Style. This changes the color of the texts of the popup too.

The Style section with the Text color next to the popup preview and its close button

Change the close button with custom CSS

To change only the close button, add custom CSS to the popup.

  1. On the Home page, open an upsell.
  2. Under Advanced, click Custom CSS.
  3. Add your CSS. The close button has the class kaching-popup__close. The icon is the svg inside it.
  4. Click Save.

This example makes the icon bigger and red:

css
.kaching-popup__close {
  width: 40px;
  height: 40px;
  color: #d72c0d;
}

.kaching-popup__close svg {
  width: 24px;
  height: 24px;
}
The Custom CSS panel with the example CSS and the popup preview with a bigger red close button

To change the close button only on mobile, put the CSS in a container query. The popup uses its mobile layout below 600 px:

css
@container (max-width: 599px) {
  .kaching-popup__close {
    width: 44px;
    height: 44px;
  }

  .kaching-popup__close svg {
    width: 22px;
    height: 22px;
  }
}

To check the result, click the Mobile preview and Desktop preview buttons above the preview.

Shoppers can also close the popup with the No thanks link under the button, or by clicking outside the popup. To hide the link:

  1. Click the buttons in the preview. The Actions panel opens.
  2. In the No thanks row, click the eye icon.
  3. Click Save.
The Actions panel with the eye icon in the No thanks row

The close button and a click outside the popup still close it.