theme

package
v0.0.0-...-d88b4ad Latest Latest
Warning

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

Go to latest
Published: Nov 16, 2026 License: MIT Imports: 3 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Apply

func Apply(c *ui.Context)

Apply makes the frame use Lobe UI's light or dark theme, following the system's appearance.

func ColorTokenNames

func ColorTokenNames() []string

func Mix

func Mix(c, o ui.Color, t float32) ui.Color

Types

type Config

type Config struct {
	// contains filtered or unexported fields
}

Config is a light and a dark set of tokens that a window applies in place of Lobe UI's defaults, such as tokens generated from an app's own brand. Make it once with NewConfig and apply it at the top of each view; the components inside then draw with its tokens.

func Default

func Default() *Config

Default returns the Config of Lobe UI's own tokens, which Apply uses.

func NewConfig

func NewConfig(light, dark Tokens) *Config

NewConfig makes a Config from a light and a dark set of tokens. Their Dark fields are set to match. Keep the Config for the life of the app rather than making one for each frame: every Config is remembered.

func (*Config) Apply

func (cfg *Config) Apply(c *ui.Context)

Apply makes the frame use the Config's light or dark theme, following the system's appearance.

func (*Config) Theme

func (cfg *Config) Theme(dark bool) *ui.Theme

Theme returns the Config's dark or light theme, for a Themed subtree.

func (*Config) Tokens

func (cfg *Config) Tokens(dark bool) *Tokens

Tokens returns a copy of the Config's dark or light tokens.

type Elevation

type Elevation int

Elevation is one of Lobe UI's shadows: BoxShadow for dialogs, BoxShadowSecondary for popovers and menus, BoxShadowTertiary for tooltips.

const (
	BoxShadow Elevation = iota
	BoxShadowSecondary
	BoxShadowTertiary
)

type Size

type Size int
const (
	Middle Size = iota
	Small
	Large
)

type Tokens

type Tokens struct {
	Dark                   bool
	Blue                   ui.Color
	BlueActive             ui.Color
	BlueFillQuaternary     ui.Color
	BlueFillTertiary       ui.Color
	BgBase                 ui.Color
	BgBlur                 ui.Color
	BgContainer            ui.Color
	BgContainerDisabled    ui.Color
	BgContainerSecondary   ui.Color
	BgElevated             ui.Color
	BgLayout               ui.Color
	BgMask                 ui.Color
	BgSolid                ui.Color
	BgSolidActive          ui.Color
	BgSolidHover           ui.Color
	BgSpotlight            ui.Color
	BgTextActive           ui.Color
	BgTextHover            ui.Color
	Border                 ui.Color
	BorderBg               ui.Color
	BorderDisabled         ui.Color
	BorderSecondary        ui.Color
	Error                  ui.Color
	ErrorActive            ui.Color
	ErrorAffix             ui.Color
	ErrorBg                ui.Color
	ErrorBgActive          ui.Color
	ErrorBgFilledHover     ui.Color
	ErrorBgHover           ui.Color
	ErrorBorder            ui.Color
	ErrorBorderHover       ui.Color
	ErrorFill              ui.Color
	ErrorFillQuaternary    ui.Color
	ErrorFillSecondary     ui.Color
	ErrorFillTertiary      ui.Color
	ErrorHover             ui.Color
	ErrorOutline           ui.Color
	ErrorText              ui.Color
	ErrorTextActive        ui.Color
	ErrorTextHover         ui.Color
	Fill                   ui.Color
	FillAlter              ui.Color
	FillContent            ui.Color
	FillContentHover       ui.Color
	FillQuaternary         ui.Color
	FillSecondary          ui.Color
	FillTertiary           ui.Color
	Highlight              ui.Color
	Icon                   ui.Color
	IconHover              ui.Color
	Info                   ui.Color
	InfoActive             ui.Color
	InfoBg                 ui.Color
	InfoBgHover            ui.Color
	InfoBorder             ui.Color
	InfoBorderHover        ui.Color
	InfoFill               ui.Color
	InfoFillQuaternary     ui.Color
	InfoFillSecondary      ui.Color
	InfoFillTertiary       ui.Color
	InfoHover              ui.Color
	InfoText               ui.Color
	InfoTextActive         ui.Color
	InfoTextHover          ui.Color
	Link                   ui.Color
	LinkActive             ui.Color
	LinkHover              ui.Color
	Primary                ui.Color
	PrimaryActive          ui.Color
	PrimaryBg              ui.Color
	PrimaryBgHover         ui.Color
	PrimaryBorder          ui.Color
	PrimaryBorderHover     ui.Color
	PrimaryFill            ui.Color
	PrimaryFillQuaternary  ui.Color
	PrimaryFillSecondary   ui.Color
	PrimaryFillTertiary    ui.Color
	PrimaryHover           ui.Color
	PrimaryText            ui.Color
	PrimaryTextActive      ui.Color
	PrimaryTextHover       ui.Color
	Shadow                 ui.Color
	Split                  ui.Color
	Success                ui.Color
	SuccessActive          ui.Color
	SuccessBg              ui.Color
	SuccessBgHover         ui.Color
	SuccessBorder          ui.Color
	SuccessBorderHover     ui.Color
	SuccessFill            ui.Color
	SuccessFillQuaternary  ui.Color
	SuccessFillSecondary   ui.Color
	SuccessFillTertiary    ui.Color
	SuccessHover           ui.Color
	SuccessText            ui.Color
	SuccessTextActive      ui.Color
	SuccessTextHover       ui.Color
	Text                   ui.Color
	TextBase               ui.Color
	TextDescription        ui.Color
	TextDisabled           ui.Color
	TextHeading            ui.Color
	TextLabel              ui.Color
	TextLightSolid         ui.Color
	TextPlaceholder        ui.Color
	TextQuaternary         ui.Color
	TextSecondary          ui.Color
	TextTertiary           ui.Color
	Warning                ui.Color
	WarningActive          ui.Color
	WarningAffix           ui.Color
	WarningBg              ui.Color
	WarningBgHover         ui.Color
	WarningBorder          ui.Color
	WarningBorderHover     ui.Color
	WarningFill            ui.Color
	WarningFillQuaternary  ui.Color
	WarningFillSecondary   ui.Color
	WarningFillTertiary    ui.Color
	WarningHover           ui.Color
	WarningOutline         ui.Color
	WarningText            ui.Color
	WarningTextActive      ui.Color
	WarningTextHover       ui.Color
	White                  ui.Color
	Cyan                   ui.Color
	CyanActive             ui.Color
	CyanFillQuaternary     ui.Color
	CyanFillTertiary       ui.Color
	Geekblue               ui.Color
	Geekblue8              ui.Color
	Geekblue9              ui.Color
	GeekblueActive         ui.Color
	GeekblueFillQuaternary ui.Color
	GeekblueFillTertiary   ui.Color
	Gold                   ui.Color
	GoldActive             ui.Color
	GoldFillQuaternary     ui.Color
	GoldFillTertiary       ui.Color
	Gray                   ui.Color
	Gray10                 ui.Color
	Gray11                 ui.Color
	Gray7                  ui.Color
	Gray9                  ui.Color
	GrayActive             ui.Color
	GrayFillQuaternary     ui.Color
	GrayFillTertiary       ui.Color
	Green                  ui.Color
	GreenActive            ui.Color
	GreenFillQuaternary    ui.Color
	GreenFillTertiary      ui.Color
	Lime                   ui.Color
	LimeActive             ui.Color
	LimeFillQuaternary     ui.Color
	LimeFillTertiary       ui.Color
	Magenta                ui.Color
	Magenta8               ui.Color
	Magenta9               ui.Color
	MagentaActive          ui.Color
	MagentaFillQuaternary  ui.Color
	MagentaFillTertiary    ui.Color
	Orange                 ui.Color
	Orange9                ui.Color
	OrangeActive           ui.Color
	OrangeFillQuaternary   ui.Color
	OrangeFillTertiary     ui.Color
	PrimaryForeground      ui.Color
	Purple                 ui.Color
	Purple8                ui.Color
	Purple9                ui.Color
	PurpleActive           ui.Color
	PurpleFillQuaternary   ui.Color
	PurpleFillTertiary     ui.Color
	Red                    ui.Color
	RedActive              ui.Color
	RedFillQuaternary      ui.Color
	RedFillTertiary        ui.Color
	Volcano                ui.Color
	Volcano8               ui.Color
	Volcano9               ui.Color
	VolcanoActive          ui.Color
	VolcanoFillQuaternary  ui.Color
	VolcanoFillTertiary    ui.Color
	Yellow                 ui.Color
	Yellow9                ui.Color
	YellowActive           ui.Color
	YellowFillQuaternary   ui.Color
	YellowFillTertiary     ui.Color
	BorderRadius           float32
	BorderRadiusLG         float32
	BorderRadiusSM         float32
	BorderRadiusXS         float32
	ControlHeight          float32
	ControlHeightLG        float32
	ControlHeightSM        float32
	ControlHeightXS        float32
	FontSize               float32
	FontSizeHeading1       float32
	FontSizeHeading2       float32
	FontSizeHeading3       float32
	FontSizeHeading4       float32
	FontSizeHeading5       float32
	FontSizeLG             float32
	FontSizeSM             float32
	FontSizeXL             float32
	FontWeightStrong       float32
	LineWidth              float32
}

func Dark

func Dark() *Tokens

func Light

func Light() *Tokens

func TokensOf

func TokensOf(c *ui.Context) *Tokens

TokensOf returns a copy of the tokens of the theme the widgets being built take: those of the Config that made it, or Lobe UI's light or dark tokens for any other theme.

func (*Tokens) Color

func (t *Tokens) Color(name string) (ui.Color, bool)

func (*Tokens) Elevate

func (t *Tokens) Elevate(e ui.Element, level Elevation) ui.Element

Elevate gives e the shadow of level and Lobe UI's one-pixel ring around it.

func (*Tokens) FillBorder

func (t *Tokens) FillBorder() ui.Color

func (*Tokens) FillBorderStrong

func (t *Tokens) FillBorderStrong() ui.Color

func (*Tokens) Theme

func (t *Tokens) Theme() *ui.Theme

Jump to

Keyboard shortcuts

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