GlassStyle

sealed interface GlassStyle

An opaque, immutable sequence of recorded Glass appearance writes.

The builder passed to GlassStyle executes once during construction. Each property is validated and captured as an immutable write; resolving a Style only replays those captured values and never invokes caller code. Combine Styles with then. Writes run in order and the last write to a property wins. The companion object is the empty Style and performs no writes.

Mutating an input captured by a previously constructed Style has no effect. To update a node, construct and supply a replacement Style through recomposition.

A Style contains no renderer or mutable runtime state. GlassStyleScope.hovered, GlassStyleScope.focused, GlassStyleScope.pressed, GlassStyleScope.interactionLightRadiusFraction, and GlassStyleScope.interactionPositionAnimationSpec record reusable interaction presentation; each hazeGlass node replays it into a fresh node-owned snapshot and owns its signals, geometry, animations, pointer observation, and renderer resources.

The same final Style is replayed unchanged into whichever private renderer Haze selects. Full renderers consume every supported authored channel. Limited renderers preserve supported channels, approximate supported lighting, and omit unsupported base and interaction optics. Selection is automatic; callers do not need a capability check or a second fallback Style.

Inheritors

Types

Link copied to clipboard

The empty Glass Style, which performs no writes.

Functions

Link copied to clipboard
open infix fun then(other: GlassStyle): GlassStyle

Returns a Style which replays other after this Style.

open fun then(block: GlassStyleScope.() -> Unit): GlassStyle

Returns a Style which replays the writes recorded by block after this Style.