BackgroundSizeContext

class BackgroundSizeContext(values: MutableList<Property>)

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

This context is passed as receiver by BackgroundContext.sizes 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 BackgroundSizes as parameters or arbitrary property values.

sizes { /* it == BackgroundSizeContext.() -> Unit */
horizontal { auto }
vertical { "80%" }
}

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

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

Functions

horizontal
Link copied to clipboard
fun horizontal(value: BackgroundSizes.() -> BackgroundSizeProperty): Boolean
vertical
Link copied to clipboard
fun vertical(value: BackgroundSizes.() -> BackgroundSizeProperty): Boolean