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
js
fun BackgroundSizeContext(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: BackgroundSizes.() -> BackgroundSizeProperty): Boolean
toString
Link copied to clipboard
js
open fun toString(): String
vertical
Link copied to clipboard
js
fun vertical(value: BackgroundSizes.() -> BackgroundSizeProperty): Boolean