Documentation
¶
Overview ¶
Package theme provides a dashboard-specific wrapper around the forgeui theme system. It adds dark mode cookie persistence, custom CSS injection, and theme configuration tailored to the Forge dashboard shell.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
Manager handles theme rendering for the dashboard shell. It wraps the forgeui theme package and adds dashboard-specific functionality such as custom CSS injection and body class selection.
func NewManager ¶
func NewManager(config ThemeConfig) *Manager
NewManager creates a new theme manager with the given configuration.
func (*Manager) CustomCSSNode ¶
CustomCSSNode returns a <style> tag with custom CSS, or nil if no custom CSS is configured.
func (*Manager) HeadNodes ¶
HeadNodes returns all theme-related nodes to include in <head>. This includes: meta tags, CSS variable definitions, Tailwind config, dark mode flash prevention script, and optional custom CSS.
func (*Manager) ThemeBodyClass ¶
ThemeBodyClass returns CSS classes for the <body> tag based on the theme mode.
- "light" mode: returns "" (no dark class needed)
- "dark" mode: returns "dark" (forces dark theme)
- "auto" mode: returns "" (Alpine.js / DarkModeScript handles the toggle at runtime)
type ThemeConfig ¶
type ThemeConfig struct {
Mode string // "light", "dark", "auto"
CustomCSS string // user-provided custom CSS to inject
}
ThemeConfig holds dashboard-specific theme configuration.
func DefaultThemeConfig ¶
func DefaultThemeConfig() ThemeConfig
DefaultThemeConfig returns the default theme config.