Documentation
¶
Index ¶
- Variables
- type Elevation
- type Opt
- func Center() Opt
- func Clip() Opt
- func Cover() Opt
- func Fill() Opt
- func Fixed() Opt
- func Flush() Opt
- func FontWeight(w Weight) Opt
- func Frame(ratio Ratio) Opt
- func Grid(min Track, gap Space) Opt
- func On(s Surface) Opt
- func Pad(s Space) Opt
- func Raise(e Elevation) Opt
- func Reel(gap Space) Opt
- func Round(rad Radius) Opt
- func Row(gap Space) Opt
- func Scrolls() Opt
- func Split(ratio Ratio, gap Space) Opt
- func Stack(gap Space) Opt
- func Text(ts TextSize) Opt
- func Width(s Size) Opt
- type Radius
- type Ratio
- type Rule
- type Sheet
- type Size
- type Space
- type Styler
- type Surface
- type TextSize
- type Track
- type Triplet
- type Weight
Constants ¶
This section is empty.
Variables ¶
var ( ColorBackgroundHover = css.Token{Name: "--color-background-hover", Fallback: "#f2f2f7"} ColorSurfaceHover = css.Token{Name: "--color-surface-hover", Fallback: "#e5e5ea"} ColorPrimaryHover = css.Token{Name: "--color-primary-hover", Fallback: "#0096bc"} ColorSecondaryHover = css.Token{Name: "--color-secondary-hover", Fallback: "#503cd1"} ColorSelectionHover = css.Token{Name: "--color-selection-hover", Fallback: "#0062cc"} ColorSuccessHover = css.Token{Name: "--color-success-hover", Fallback: "#34a243"} ColorErrorHover = css.Token{Name: "--color-error-hover", Fallback: "#cf3c15"} ColorMutedHover = css.Token{Name: "--color-muted-hover", Fallback: "#55555a"} ColorBackgroundFocus = css.Token{Name: "--color-background-focus", Fallback: "#ffffff"} ColorSurfaceFocus = css.Token{Name: "--color-surface-focus", Fallback: "#f2f2f7"} ColorPrimaryFocus = css.Token{Name: "--color-primary-focus", Fallback: "#0096bc"} ColorSecondaryFocus = css.Token{Name: "--color-secondary-focus", Fallback: "#503cd1"} ColorSelectionFocus = css.Token{Name: "--color-selection-focus", Fallback: "#0062cc"} ColorBackgroundPress = css.Token{Name: "--color-background-press", Fallback: "#e5e5ea"} ColorSurfacePress = css.Token{Name: "--color-surface-press", Fallback: "#d1d1d6"} ColorPrimaryPress = css.Token{Name: "--color-primary-press", Fallback: "#0080a0"} ColorSecondaryPress = css.Token{Name: "--color-secondary-press", Fallback: "#4532be"} ColorSelectionPress = css.Token{Name: "--color-selection-press", Fallback: "#0052b3"} )
Tokens de estados interactivos locales (Hover, Focus, Press)
Functions ¶
This section is empty.
Types ¶
type Opt ¶
type Opt func(*Rule)
Opt es una opción visual que configura una regla.
type Rule ¶
type Rule struct {
HasFlow bool
FlowType string // "stack", "row", "split", "grid", "center", "cover", "reel", "frame"
FlowGap Space
FlowRatio Ratio
FlowTrack Track
HasSurface bool
Surface Surface
HasPad bool
Pad Space
HasRound bool
Round Radius
HasRaise bool
Raise Elevation
HasSize bool
Size Size
Fill bool
Scrolls bool
Fixed bool
Flush bool
Clip bool
HasTextSize bool
TextSize TextSize
HasWeight bool
Weight Weight
}
Rule contiene todas las propiedades visuales acumuladas para un elemento (Root o Part).
type Sheet ¶
type Sheet struct {
Name widget.Name
RootRule Rule
PartRules map[widget.Part]Rule
StateRules map[stateKey]Rule
CueRules map[cueKey]Rule
}
Sheet representa el bloque de estilo scoped a un widget.
func (*Sheet) Cue ¶
Cue define el estilo de una parte (o Root si p es "") cuando el navegador posee un cue (hover, focus, etc.).
func (*Sheet) Stylesheet ¶
func (s *Sheet) Stylesheet() *css.Stylesheet
Stylesheet genera un css.Stylesheet para el Sheet.
type Size ¶
type Size uint8
Size es la ÚNICA medida de ancho. Relativa al contenedor, nunca al viewport — las unidades vw/vh no existen en esta API.
type Surface ¶
type Surface uint8
Surface es una decisión visual completa: fondo, texto y borde resueltos como UNA tripleta. No hay forma de elegir un fondo sin su texto.
const ( Page Surface = iota PageHover PageFocus PagePress Panel PanelHover PanelFocus PanelPress Sunken SunkenHover SunkenFocus SunkenPress Accent AccentHover AccentFocus AccentPress Secondary SecondaryHover SecondaryFocus SecondaryPress Selected SelectedHover SelectedFocus SelectedPress Success SuccessHover SuccessFocus SuccessPress Danger DangerHover DangerFocus DangerPress Muted MutedHover MutedFocus MutedPress Disabled )