Customize Template Theme
This guide addresses how to customize the theme of a template.
To implement a custom template theme you should declare a generic class and a specific class implementation for all the templates that should be supported, e.g. here is an example of what the definition of a DarkTheme
might look like for the MaterialTemplate
.
Once these classes are created, the themes can be imported and applied to a template. We will use the generic DarkTheme
that is shipped with Panel to simplify the example below:
:::{card} app.py
:::
Now, we can activate this app on the command line:
Related Resources
See How-to > Apply Templates > Build a Custom Template to create a completely custom template.
See How-to > Apply Templates > Set a Template for alternate approaches to set a template.
Read Background > Templates for explanation.