pub struct Brand {
pub name: String,
pub logo: Option<String>,
pub dark_logo: Option<String>,
pub favicon: Option<String>,
/* private fields */
}Expand description
Branding for the panel’s shell: the sidebar header, the login card, and the
topbar below md, where the sidebar folds into a sheet.
Fields§
§name: StringDisplay name (e.g. "Acme").
logo: Option<String>Optional logo URL (e.g. "/logo.svg"). Rendered as an <img> when present.
dark_logo: Option<String>Optional logo URL shown in place of logo while the page renders dark.
favicon: Option<String>Optional favicon URL (e.g. "/favicon.svg"), the <link rel="icon"> of every page the
panel renders, its sign-in pages included.
Implementations§
Source§impl Brand
impl Brand
Sourcepub fn new(name: impl Into<String>) -> Self
pub fn new(name: impl Into<String>) -> Self
Create a brand with the given name (surrounding whitespace is
trimmed so " Acme " cannot break the flex h-16 header).
Sourcepub fn color(self, color: impl Into<String>) -> Self
pub fn color(self, color: impl Into<String>) -> Self
Paint the panel’s primary color, its buttons, links, focus rings and brand mark, in
color: a hex color or a color function such as oklch(0.55 0.2 260). It paints the dark
theme too, unless dark_color says otherwise. Mounting the panel
refuses any other spelling, which the page’s stylesheet would carry as it is.
Sourcepub fn dark_color(self, color: impl Into<String>) -> Self
pub fn dark_color(self, color: impl Into<String>) -> Self
Paint the primary color in color while the page renders dark, such as a lighter shade
of color for a dark background.
Sourcepub fn on_color(self, color: impl Into<String>) -> Self
pub fn on_color(self, color: impl Into<String>) -> Self
Paint the text on the primary color in color, over the shipped near-white: a dark
color for a light color, such as yellow.
Sourcepub fn logo(self, logo: impl Into<String>) -> Self
pub fn logo(self, logo: impl Into<String>) -> Self
Attach a logo URL (blank values are ignored so an empty
logo("") falls back to the name-only render instead of a
broken-image icon).