Skip to main content

css

Optional. The name of a CSS class(es) applied to Layout

css?: string;

Example

<style>
.layout {
color: #fff;
--dhx-background-secondary: #7a7a7a;
--dhx-border-color: #bababa;
--dhx-border: var(--dhx-border-width) solid var(--dhx-border-color);
}

.layout-header {
--dhx-background-primary: #3A434A;
}
.dhx_layout-cell-inner_html {
height: 100%;
display: flex;
align-items: center;
justify-content: center;
}
</style>

<script>
const layout = new dhx.Layout("layout_container", {
type: "space",
css: "layout",
rows: [
{
id: "toolbar",
html: "Header",
css: "layout-header",
height: "60px"
},
// more objects
]
});
</script>

Related sample: Layout. 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 a Layout cell.

const layout = new dhx.Layout("layout_container", {
css: "dhx_layout-cell--bordered",
rows: [
{
id: "toolbar",
html: "Header",
css: "dhx_layout-cell--border_bottom layout-header",
gravity: false,
height: "60px"
}
]
});

Related articles: