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
js
fun BackgroundPositionContext(values: MutableList<Property>)
external container for collecting the positioning information within this context

Functions

equals
Link copied to clipboard
js
open operator fun equals(other: Any?): Boolean
hashCode
Link copied to clipboard
js
open fun hashCode(): Int
horizontal
Link copied to clipboard
js
fun horizontal(value: BackgroundPositions.() -> BackgroundPositionProperty): Boolean
toString
Link copied to clipboard
js
open fun toString(): String
vertical
Link copied to clipboard
js
fun vertical(value: BackgroundPositions.() -> BackgroundPositionProperty): Boolean