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:
--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:
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
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.
Last updated