XCover Elements
  • Welcome
    • Product Overview
  • Client Integration
    • Installation
    • Element display
    • Signals
      • Set signal
      • Listen signal
      • Update signal
    • Checkout Enablement
    • Language
    • Currency Formatting Engine
  • Element Theming
  • Integration Examples
    • HTML demo
    • Requests & Responses
Powered by GitBook
On this page
  • Theme overrides
  • Color scheme(dark | light)

Element Theming

This page outlines how to implement theme overrides and how to set a color scheme(dark or light) to our XCover Elements

Theme overrides

XCover Elements panels can be themed by adding predefined CSS custom properties and values to the root of the host website. The css custom properties are defined by XCE and are used to target specific pieces in the panel to be customized.

The following CSS custom properties can be used to customize the appearance of the panel:

Variable
Description

--xce-ext-heading-color

Customizes the text color of the panel heading

--xce-ext-heading-font-size

Customizes the font size of the panel heading

--xce-ext-heading-image-size

Customizes the size of the icon in the panel heading

--xce-ext-link-text-color

Customizes the color of links in the panel

--xce-ext-content-pill-background-color

Customizes the background color of the CTA pill

--xce-ext-content-pill-color

Customizes the text color of the CTA pill

The following example shows how to add custom CSS overrides:

:root {
    --xce-ext-heading-color: red;
    --xce-ext-heading-font-size: 24px;
    --xce-ext-heading-image-size: 32px;
    --xce-ext-link-text-color: blue;
    --xce-ext-content-pill-background-color: brown;
    --xce-ext-content-pill-color: yellow;
}

These theme variables take priority over color schemes dark and light variables. Make sure to consider aligning these variables overrides with your color scheme accordingly.

Color scheme(dark | light)

Our panels have the ability to switch between dark and light color scheme using the built in custom attribute color-scheme

To set a color scheme just pass in a string value to the color-scheme attribute with either dark or light

<!-- custom attributes example -->
<!-- with 'dark' mode -->
<xce-protection-offer color-scheme="dark"></xce-protection-offer>

<!-- with 'light' mode -->
<xce-protection-offer color-scheme="light"></xce-protection-offer>

The default color scheme for our panels is set to light mode.

Elements color scheme will not change based on browser or user computer theme.

In case you want to change color scheme based on browser or user computer the attribute would have to be added programmatically by the developer.

PreviousCurrency Formatting EngineNextHTML demo

Last updated 24 days ago