theme

package
v1.1.2 Latest Latest
Warning

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

Go to latest
Published: Oct 16, 2026 License: BSD-3-Clause Imports: 7 Imported by: 0 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

View Source
const (
	ColorBlue   = "blue"
	ColorBrown  = "brown"
	ColorGray   = "gray"
	ColorGreen  = "green"
	ColorOrange = "orange"
	ColorPurple = "purple"
	ColorRed    = "red"
	ColorYellow = "yellow"
)

Primary color names.

View Source
const (
	VariantDark bellui.ThemeVariant = iota
	VariantLight
	VariantNameUserPreference // locally used in builtinTheme for backward compatibility
)

Theme variants; the public available ones are defined in /theme/theme.go.

Variables

This section is empty.

Functions

func CurrentlyRenderingWithFallback

func CurrentlyRenderingWithFallback(f bellui.Theme) bellui.Theme

CurrentlyRenderingWithFallback returns the theme that is currently being used during rendering or layout calculations. If there is no override in effect then the fallback is returned.

func DeviceIsMobileForWidget

func DeviceIsMobileForWidget(w core.Widget) (mobile bool, ok bool)

DeviceIsMobileForWidget checks whether the widget's theme overrides the device-is-mobile flag. Returns the override value and true if set, or false and false if no override exists.

func ForegroundOnPrimaryColorNamed

func ForegroundOnPrimaryColorNamed(name string) color.Color

ForegroundOnPrimaryColorNamed returns a theme specific color used for text and icons against the named primary color.

func PopRenderingTheme

func PopRenderingTheme()

PopRenderingTheme is used by the ThemeOverride container to remove an overridden theme during rendering and calculations.

func PrimaryColorNamed

func PrimaryColorNamed(name string) color.Color

PrimaryColorNamed returns a theme specific color value for a named primary color.

func PushRenderingTheme

func PushRenderingTheme(th bellui.Theme)

PushRenderingTheme is used by the ThemeOverride container to stack the current theme during rendering and calculations.

Types

type MobileTheme

type MobileTheme interface {
	DeviceIsMobile() bool
}

MobileTheme is implemented by themes that override the device-is-mobile flag. ThemeOverride uses this to force mobile layout in containers like AppTabs.

type RenderStyle

type RenderStyle string

RenderStyle identifies a visual rendering style that widget renderers can switch on.

const (
	// RenderStyleClassic is the original Bellui look. This is the default when the
	// theme does not implement RenderStyleTheme.
	RenderStyleClassic RenderStyle = ""

	// RenderStyleModern provides enhanced visuals: gradient buttons, deeper shadows,
	// larger corner radii, and stronger hover/focus feedback.
	RenderStyleModern RenderStyle = "modern"
)

func RenderStyleForWidget

func RenderStyleForWidget(w core.Widget) RenderStyle

RenderStyleForWidget returns the RenderStyle for the given widget's theme. Returns RenderStyleClassic if the theme does not provide a render style.

type RenderStyleTheme

type RenderStyleTheme interface {
	RenderStyle() RenderStyle
}

RenderStyleTheme is implemented by themes that provide a render style selection. Widget renderers type-assert the current theme to this interface to decide between classic and modern visuals.

Jump to

Keyboard shortcuts

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