theme

package
v0.9.12 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 18, 2026 License: Apache-2.0 Imports: 3 Imported by: 0

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

func (m *Manager) CustomCSSNode() g.Node

CustomCSSNode returns a <style> tag with custom CSS, or nil if no custom CSS is configured.

func (*Manager) HeadNodes

func (m *Manager) HeadNodes() []g.Node

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

func (m *Manager) ThemeBodyClass() string

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL