Files
iris/ui/modifiers.go
Hugo Nijhuis 9642fd008e
All checks were successful
CI / build (push) Successful in 27s
Remove internal package import from todo example
Replace direct internal/element usage with public ui package
components to ensure examples only use the public API:

- Add ui.RawCheckbox for plain checkbox without label wrapper
- Add ui.Span for span elements with text content
- Add View.TextDecoration modifier for strikethrough styling
- Update todo example to use these public components

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-09 16:29:57 +00:00

178 lines
3.6 KiB
Go

package ui
func (v View) SpaceEvenly() View {
v.e.Get("style").Call("setProperty", "justify-content", "space-evenly")
return v
}
func (v View) SpaceBetween() View {
v.e.Get("style").Call("setProperty", "justify-content", "space-between")
return v
}
func (v View) AlignCenter() View {
v.e.Get("style").Call("setProperty", "align-items", "center")
return v
}
func (v View) AlignRight() View {
v.e.Get("style").Call("setProperty", "align-items", "flex-end")
return v
}
func (v View) AlignLeft() View {
v.e.Get("style").Call("setProperty", "align-items", "flex-start")
return v
}
func (v View) JustifyContent(justify string) View {
v.e.Get("style").Call("setProperty", "justify-content", justify)
return v
}
func (v View) Margin(margin string) View {
v.e.Get("style").Call("setProperty", "margin", margin)
return v
}
func (v View) Padding(padding string) View {
v.e.Get("style").Call("setProperty", "padding", padding)
return v
}
func (v View) Font(font Font) View {
v.e.Get("style").Call("setProperty", "font", font.String())
v.e.Get("style").Call("setProperty", "line-height", font.lineheight)
return v
}
func (v View) Color(color string) View {
v.e.Get("style").Call("setProperty", "color", color)
return v
}
func (v View) Gap(gap string) View {
v.e.Get("style").Call("setProperty", "gap", gap)
return v
}
func (v View) Border(border string) View {
v.e.Get("style").Call("setProperty", "border", border)
return v
}
func (v View) BorderTop(border string) View {
v.e.Get("style").Call("setProperty", "border-top", border)
return v
}
func (v View) BorderBottom(border string) View {
v.e.Get("style").Call("setProperty", "border-bottom", border)
return v
}
func (v View) BorderLeft(border string) View {
v.e.Get("style").Call("setProperty", "border-left", border)
return v
}
func (v View) BorderRight(border string) View {
v.e.Get("style").Call("setProperty", "border-right", border)
return v
}
func (v View) TextAlign(align string) View {
v.e.Get("style").Call("setProperty", "text-align", align)
return v
}
func (v View) MaxWidth(width string) View {
v.e.MaxWidth(width)
return v
}
func (v View) Width(width string) View {
v.e.Width(width)
return v
}
func (v View) Height(height string) View {
v.e.Height(height)
return v
}
func (v View) Background(color string) View {
v.e.BackgroundColor(color)
return v
}
func (v View) Foreground(color string) View {
v.e.Color(color)
return v
}
func (v View) MinHeight(height string) View {
v.e.MinHeight(height)
return v
}
func (v View) BoxShadow(shadow string) View {
v.e.BoxShadow(shadow)
return v
}
func (v View) BorderRadius(radius string) View {
v.e.BorderRadius(radius)
return v
}
func (v View) Cursor(cursor string) View {
v.e.Cursor(cursor)
return v
}
func (v View) Position(pos string) View {
v.e.Position(pos)
return v
}
func (v View) Left(value string) View {
v.e.Left(value)
return v
}
func (v View) Top(value string) View {
v.e.Top(value)
return v
}
func (v View) Overflow(value string) View {
v.e.Overflow(value)
return v
}
func (v View) Display(value string) View {
v.e.Get("style").Call("setProperty", "display", value)
return v
}
func (v View) GridTemplateColumns(value string) View {
v.e.Get("style").Call("setProperty", "grid-template-columns", value)
return v
}
func (v View) AlignItems(value string) View {
v.e.Get("style").Call("setProperty", "align-items", value)
return v
}
func (v View) PointerEvents(value string) View {
v.e.PointerEvents(value)
return v
}
func (v View) TextDecoration(value string) View {
v.e.Get("style").Call("setProperty", "text-decoration", value)
return v
}