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;
}

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.

Last updated