# Element Theming

## 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:

<table data-full-width="true"><thead><tr><th>Variable</th><th>Description</th></tr></thead><tbody><tr><td><code>--xce-ext-heading-color</code></td><td>Text color of the panel heading</td></tr><tr><td><code>--xce-ext-heading-font-size</code></td><td>Font size of the panel heading</td></tr><tr><td><code>--xce-ext-heading-image-size</code></td><td>Icon size of the panel heading</td></tr><tr><td><code>--xce-ext-link-text-color</code></td><td>Text links color of the overall panel</td></tr><tr><td><code>--xce-ext-content-pill-background-color</code></td><td>Background color of the CTA pill</td></tr><tr><td><code>--xce-ext-content-pill-color</code></td><td>Text color of the CTA pill</td></tr><tr><td><code>--xce-ext-options-warning-panel-display</code></td><td>Display value of the Warning Panel when selecting Reject option</td></tr><tr><td><code>--xce-ext-options-selected-color</code></td><td>Color of the options border, radio input border and background when selecting an option</td></tr><tr><td><code>--xce-ext-options-error-color</code></td><td>Color of the options border, radio input border, background and the required message text when triggering error state</td></tr><tr><td><code>--xce-ext-options-radio-background-color</code></td><td>Background color of the options radio input on default state</td></tr><tr><td><code>--xce-ext-options-radio-error-background-color</code></td><td>Background color of the options radio input when triggering error state</td></tr><tr><td><code>--xce-ext-options-radio-border-color</code></td><td>Border color of the options radio input on default state</td></tr><tr><td><code>--xce-ext-options-radio-size</code></td><td>Size of the options radio input on any state</td></tr><tr><td><code>--xce-ext-options-radio-border-weight</code></td><td>Border weight of the options radio input on any state</td></tr></tbody></table>

The following example shows how to add custom CSS overrides:

<pre class="language-css"><code class="lang-css">:root {
<strong>    --xce-ext-heading-color: red;
</strong>    --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;
}
</code></pre>

{% hint style="warning" %}
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.
{% endhint %}

## 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`

```html
<!-- 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.

{% hint style="warning" %}
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.
{% endhint %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://partner-docs.covergenius.com/xcover-elements/client-integration/element-theming.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
