struct ViewStyle
Swift
struct ViewStyle
Style a modifier pushes onto a node.
Every field is optional and merging is per field: whole-struct replacement would let the last modifier in a chain silently clear the others, which the spike caught before it could become a bug report.
Sources/LavaUI/Modifiers.swift:26
Constructors
init()
Not documented.
Sources/LavaUI/Modifiers.swift:74
Properties
var backdropBlurRadius: Float?
Backdrop blur radius in pixels under this node's rect. nil = off.
Emits BeginBackdropBlur / EndBackdropBlur around the node's paint
so earlier UI is frosted and this node's fill + children stay sharp.
Sources/LavaUI/Modifiers.swift:47
var border: BorderStyle?
Stroke on this node's edge, drawn over its children. See
View.border(_:width:).
Sources/LavaUI/Modifiers.swift:62
var clipsContent: Bool?
Scissor paint to this node's layout rect (SwiftUI .clipped()).
Sources/LavaUI/Modifiers.swift:52
var contentBlurRadius: Float?
Content blur radius in pixels. nil = off. Blurs this node's own paint,
the way SwiftUI's .blur() does, rather than what is behind it.
Sources/LavaUI/Modifiers.swift:50
var cornerRadius: Float?
Not documented.
Sources/LavaUI/Modifiers.swift:37
var cursor: CursorShape?
Pointer image over this view. nil inherits. See View.cursor(_:).
Sources/LavaUI/Modifiers.swift:57
var fill: Color?
Not documented.
Sources/LavaUI/Modifiers.swift:29
var fillGradient: Gradient?
A two-stop linear fill, which wins over fill when both are set.
Separate rather than making fill an enum: fill is read in a dozen
places that only ever want a flat colour, and widening it would make
every one of them handle a case it has no use for.
Sources/LavaUI/Modifiers.swift:35
var flexGrow: Float?
Not documented.
Sources/LavaUI/Modifiers.swift:42
var flexShrink: Float?
Not documented.
Sources/LavaUI/Modifiers.swift:43
var frameAlignment: Alignment?
Where content sits inside a frame bigger than it — see
View.frame(width:height:minWidth:minHeight:alignment:).
Unlike every other field here, this one changes the shape of the
tree rather than a property of one node: content can only be placed
inside a box if there is a box distinct from the content, so a frame
that states an alignment always wraps. nil means the frame was never
asked the question, which is not the same as being asked and answered
.center.
Sources/LavaUI/Modifiers.swift:72
var height: Dimension?
Not documented.
Sources/LavaUI/Modifiers.swift:39
var hoverFill: Color?
Not documented.
Sources/LavaUI/Modifiers.swift:36
var hoverSnap: Bool?
Snap hover off rather than ease it. See View.hoverSnap(_:).
Sources/LavaUI/Modifiers.swift:59
var isHidden: Bool?
Take this subtree out of layout and drawing without unmounting it.
nil = visible. See View.hidden(_:).
Sources/LavaUI/Modifiers.swift:55
var minHeight: Float?
Not documented.
Sources/LavaUI/Modifiers.swift:41
var minWidth: Float?
Not documented.
Sources/LavaUI/Modifiers.swift:40
var padding: EdgeInsets?
Per-edge inset. nil means "leave the node's baseline alone".
Sources/LavaUI/Modifiers.swift:28
var width: Dimension?
Not documented.
Sources/LavaUI/Modifiers.swift:38