css

package
v0.1.5 Latest Latest
Warning

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

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

Documentation

Overview

Package css holds the nechat stylesheet and its theme overrides. Hosts use it through nekit.ChatTheme.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FaceKey

func FaceKey(dark Theme, light Theme) string

FaceKey returns a short hash identifying the overrides in dark and light, or "" when neither sets a usable colour.

func LayoutKey

func LayoutKey(l Layout) string

func Style

func Style(dark Theme, light Theme, layout Layout) gox.Elem

Style renders the nechat stylesheet link and, when dark or light set any colour or layout differs from the defaults, rules applying them to widgets whose data-nechat-theme is their FaceKey and whose data-nechat-layout is their LayoutKey.

Types

type Layout

type Layout struct {
	// Side is the page edge the chat sits at; the zero value is the right edge.
	Side Side
	// Width is the floating window's width; default 25rem.
	Width string
	// Height is the floating window's height; default 40rem.
	Height string
	// DockWidth is the docked panel's width, which the page makes room for; default 28rem.
	DockWidth string
}

type Side

type Side uint8
const (
	Right Side = iota
	Left
)

type Theme

type Theme struct {
	// AppBg is the widget background.
	AppBg string
	// AppBorder is the colour of borders and dividers; hover backgrounds derive from it.
	AppBorder string
	// AppInk is the main text colour.
	AppInk string
	// AppInkQuiet is the colour of secondary text, form accents and focus rings.
	AppInkQuiet string
	// PanelBg is the background of the composer, popovers, form fields and message bubbles.
	PanelBg string
	// PanelBorderFocus is the border of input fields, the composer, checkboxes and radio buttons,
	// hovered and pressed buttons, and focused surfaces.
	PanelBorderFocus string
	// ButtonBorder is the border of buttons and the background of pressed buttons and controls.
	ButtonBorder string
	// ButtonInk is the text and icon colour of buttons.
	ButtonInk string
	// ButtonInkOff is the text and icon colour of disabled buttons.
	ButtonInkOff string
	// SecondaryBg is the background of secondary buttons, the context gauge and attached files.
	SecondaryBg string
	// DangerInk is the text colour of destructive actions and errors.
	DangerInk string
	// DangerBgHover is the fill of a hovered destructive button.
	DangerBgHover string
	// DangerBgActive is the fill of a pressed destructive button.
	DangerBgActive string
	// DangerInkOnFill is the text colour on a danger fill.
	DangerInkOnFill string
	// LauncherBg is the fill of the round button that opens a collapsed chat; it defaults to AppInk.
	LauncherBg string
	// LauncherInk is the icon colour of the round button that opens a collapsed chat; it defaults to AppBg.
	LauncherInk string
}

Theme overrides colours of one face of the nechat palette. Each field takes any CSS colour value, such as "#18181b" or "var(--my-bg)"; an empty field keeps the default, and a value containing any of {};< is ignored.

Jump to

Keyboard shortcuts

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