Skip to main content

css

Optional. Adds custom CSS classes to Colorpicker

css?: string;

Example‚Äč

<style>
.custom-class {
background: #f2f2f2;
border: solid 1px lightblue;
}

.custom-class .dhx_palette__cell {
border-radius: 50%;
}

.custom-class .dhx_palette__cell:after {
border-radius: 50%;
}

.custom-class .dhx_colorpicker-custom-colors__picker {
border-radius: 50%;
}
</style>

<script>
const colorpicker = new dhx.Colorpicker("colorpicker_container", {
css: "custom-class dhx_widget--bordered",
});
</script>

Related sample: Colorpicker. Styling (custom CSS)

Note, that the DHTMLX library provides a set of own CSS classes that you can also apply to change the appearance of Colorpicker:

const colorpicker = new dhx.Colorpicker("colorpicker_container", {
css: "dhx_widget--bg_white"
});

Related articles: