Customization
Styling
There is a possibility to make changes in the look and feel of a popup.
Related sample: Popup. Styling (custom CSS)
For this you need to take the following steps:
- add a new CSS class(es) with desired settings in the <style> section of your HTML page or in your file with styles (don't forget to include your file on the page in this case)
<style>
.my-first-class {
/*some styles*/
}
.my-second-class {
/*some styles*/
}
</style>
- specify the name of the created CSS class (or names of classes separated by spaces) as the value of the css property in the Popup configuration:
const popup = new dhx.Popup({
css:"my-first-class my-second-class"
});
For example:
<style>
.custom {
--dhx-font-color-primary: var(--dhx-color-white);
--dhx-background-primary: var(--dhx-color-primary);
margin-top: 25px;
animation: opacity .4s ease-in-out forwards;
}
</style>
<script>
const popup = new dhx.Popup({
css: "dhx_widget--border-shadow custom"
});
// show popup
</script>