theme

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Jun 8, 2026 License: MIT Imports: 1 Imported by: 0

Documentation

Overview

Package theme is the canonical home for the framework's visual design system.

The theme provides curated tokens — colors, spacing, radii, fonts — that every framework/ui component references via CSS custom properties. To re-skin an app, pass overrides to Default; every component re-resolves to the new values without code changes.

Tokens are single-tier semantic: names carry meaning ("primary", "danger", "surface-soft") rather than raw values ("indigo-500"). If you need a deeper layering, build it on top — but most apps don't.

The output is a style.Theme (from core-ui/style), so this package composes cleanly with the existing stylesheet builder and any host that already consumes core-ui themes.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Default

func Default(overrides ...Overrides) style.Theme

Default returns the canonical framework theme.

Pass an Overrides value to swap individual tokens. Overrides are applied on top of the typed style.DefaultTheme(); unset fields keep their defaults.

Example — swap primary from indigo to teal:

t := theme.Default(theme.Overrides{Primary: "#14B8A6"})

Every component referencing --color-primary updates without any code change.

Types

type Overrides

type Overrides struct {
	// Color tokens (CSS hex values).
	Background, Surface, SurfaceSoft string
	Border, BorderStrong             string
	Text, TextMuted, TextSubtle      string
	Primary, PrimaryFg               string
	Accent                           string
	Success, Warning, Danger, Info   string

	// Code-display surface tokens (ui.CodeBlock + demo source panels).
	// Intentionally a separate pair so dark mode reskins code blocks
	// independently of the page Text/Background pair.
	CodeSurface, CodeText, CodeBorder string

	// Font families.
	FontBody, FontHeading, FontMono string

	// Reskin extras — only apply if you really need them.
	RadiusSm, RadiusMd, RadiusLg int // px
}

Overrides is the set of tokens a host can swap to re-skin the framework theme. All fields are optional. Empty strings are ignored — zero-value RadiusXX ints likewise.

Jump to

Keyboard shortcuts

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