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>) -> Brand
pub fn new(name: impl Into<String>) -> Brand
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>) -> Brand
pub fn color(self, color: impl Into<String>) -> Brand
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>) -> Brand
pub fn dark_color(self, color: impl Into<String>) -> Brand
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>) -> Brand
pub fn on_color(self, color: impl Into<String>) -> Brand
Paint the text on the primary color in color, over the theme’s: a dark
color for a light color, such as yellow.
Sourcepub fn theme(self, theme: Theme) -> Brand
pub fn theme(self, theme: Theme) -> Brand
Dress the panel in theme instead of Theme::Jade: its pages, sign-in included.
Frame the page with the sidebar as frame says instead of as the theme does.
Sourcepub fn look(self, look: fn(&Cx) -> Look) -> Brand
pub fn look(self, look: fn(&Cx) -> Look) -> Brand
Let each request pick its theme and sidebar frame over the brand’s, through the Look
look answers for it.
Sourcepub fn logo(self, logo: impl Into<String>) -> Brand
pub fn logo(self, logo: impl Into<String>) -> Brand
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).