Adding ClassName to body tag

Hello community. How does someone add ClassName property to <body> tag in dash?

Hi @Gaylord what exactly are you refering to?

Hello @Gaylord,

The only way to do this is via a JavaScript function, a clientside callback can handle it.

If you use pages:

app.clientside_callback(
“””function (n) {
    document.body.classList.add(‘mycustomclass’)
return window.dash_clientside.no_update
}”””,
Output(‘_pages_content’,’id’),
Input(‘_pages_content’,’id’)
)

Or… you could mess with the template. Though I wouldn’t recommend this.