panel.io.pages module#
Theming of the pages Panel serves outside of applications, i.e. the index, login, logout and error pages.
The pages are configured with config.page_config, which mirrors the
theming parameters of panel.ui.Page so that the same theme_config,
logo and title can be shared between the server pages and the applications.
- class panel.io.pages.PageTheme[source]#
Bases:
objectExposes
config.page_configto the page templates aspage. It is resolved on every access, so changes to the config apply without a restart and no stale state is captured at import time.- Attributes:
- config
- css
- dark_theme
- favicon
headThe stylesheets of the page, to be inserted unescaped into
<head>.- logo
- site_url
- title
Methods
brand(title[, tag, href])Renders the logo and title of the app bar, to be inserted unescaped.
- brand(title: str, tag: str = 'span', href: str | None = None) str[source]#
Renders the logo and title of the app bar, to be inserted unescaped.
- property head: str#
The stylesheets of the page, to be inserted unescaped into
<head>.
- panel.io.pages.contrast_text(color: str) str[source]#
The text color MUI’s
getContrastTextpicks for the given background. Colors that cannot be parsed are assumed to be dark.
- panel.io.pages.load_page_config(value: Any) dict[str, Any][source]#
Normalize a page configuration given as a dict, a JSON string or a path to a JSON file, and validate its keys.
- panel.io.pages.page_defaults() dict[str, Any][source]#
The branding configured as class defaults of
panel.ui.Page, e.g. by a--setupscript, so that applications and server pages share one brand configuration. Only consulted once panel-material-ui is imported, since importing it replaces the global design.