BackgroundPositionContext

class BackgroundPositionContext(values: MutableList<Property>)

Nested context class to enable separate definitions of horizontal and vertical background positioning for the background-position property.

This context is passed as receiver by BackgroundContext.positions function and is therefore nested within the BackgroundContext context.

This class exposes the two functions horizontal and vertical for defining those properties independently. You can use predefined values from BackgroundPositions as parameters or arbitrary property values.

positions { /* it == BackgroundPositionContext.() -> Unit */
horizontal { center }
vertical { top }
}

For passing only one value for both dimensions have a look at BackgroundContext.position.

Parameters

values

external container for collecting the positioning information within this context

Constructors

BackgroundPositionContext
Link copied to clipboard
fun BackgroundPositionContext(values: MutableList<Property>)
external container for collecting the positioning information within this context

Functions

horizontal
Link copied to clipboard
fun horizontal(value: BackgroundPositions.() -> BackgroundPositionProperty): Boolean
vertical
Link copied to clipboard
fun vertical(value: BackgroundPositions.() -> BackgroundPositionProperty): Boolean