Documentation
¶
Index ¶
- Variables
- type Elevation
- type Opt
- func Above() Opt
- func Backdrop(s Scope) 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 Hidden() 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 Scrim() Opt
- func Scrolls() Opt
- func Shown() 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 Scope
- 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.
func Above ¶ added in v0.3.0
func Above() Opt
Above coloca el elemento por encima de cualquier Backdrop: el desplegable de un menú, el panel de un diálogo. No lo saca del flujo por sí solo.
func Backdrop ¶ added in v0.3.0
Backdrop saca el elemento del flujo y lo estira sobre todo su Scope. Es la capa que respalda a otra: un cazaclics o un velo. Queda por encima del contenido normal y por debajo de cualquier Above().
Se llama Backdrop y no Overlay porque Overlay ya es el nivel máximo del enum Elevation (scale.go), que consumidores publicados usan como Raise(Overlay).
func Hidden ¶ added in v0.3.0
func Hidden() Opt
Hidden oculta el elemento. Es la regla base de un overlay que solo debe verse en cierto estado; se revierte con Shown() en una regla When().
func Scrim ¶ added in v0.3.0
func Scrim() Opt
Scrim rellena el elemento con un velo translúcido sobre la superficie de la página. Solo tiene sentido junto a Backdrop.
func Shown ¶ added in v0.3.0
func Shown() Opt
Shown revierte Hidden(). Va en una regla de estado, nunca en la base.
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
HasBackdrop bool
BackdropScope Scope
Above bool
Scrim bool
Hidden bool
Shown bool
}
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 )