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

Text color of the panel heading

--xce-ext-heading-font-size

Font size of the panel heading

--xce-ext-heading-image-size

Icon size of the panel heading

--xce-ext-link-text-color

Text links color of the overall panel

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

Background color of the CTA pill

--xce-ext-content-pill-color

Text color of the CTA pill

--xce-ext-options-warning-panel-display

Display value of the Warning Panel when selecting Reject option

--xce-ext-options-selected-color

Color of the options border, radio input border and background when selecting an option

--xce-ext-options-error-color

Color of the options border, radio input border, background and the required message text when triggering error state

--xce-ext-options-radio-background-color

Background color of the options radio input on default state

--xce-ext-options-radio-error-background-color

Background color of the options radio input when triggering error state

--xce-ext-options-radio-border-color

Border color of the options radio input on default state

--xce-ext-options-radio-size

Size of the options radio input on any state

--xce-ext-options-radio-border-weight

Border weight of the options radio input on any state

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;
    --xce-ext-options-warning-panel-display: none;
}
circle-exclamation

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

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

circle-exclamation

Last updated