SpacesContext

@ExperimentalCoroutinesApi
class SpacesContext(    topKey: String,     leftKey: String,     bottomKey: String,     rightKey: String,     val styleParams: StyleParams,     target: StringBuilder) : StyleParams

This context class enables the definition of the common space oriented (margin and padding) styling properties.

This context is passed as receiver either by Space.margin or Space.padding functions for setting the properties for all sides at once or by Space.margins or Space.paddings functions for defining each side independently.

This usage enable styling like this:

margin { small }

or alternatively

margins {
top { small }
left { normal }
}

Parameters

topKey

the CSS-property for the top

leftKey

the CSS-property for the left

bottomKey

the CSS-property for the bottom

rightKey

the CSS-property for the right

styleParams

basic context scope interface

target

the defined output StringBuilder to write the generated CSS into

Constructors

Link copied to clipboard
fun SpacesContext(    topKey: String,     leftKey: String,     bottomKey: String,     rightKey: String,     styleParams: StyleParams,     target: StringBuilder)

Functions

Link copied to clipboard
fun all(value: ScaledValueProperty)

This function is used to set the all paddings or margins It is usefull to override existing specific definitions for top, etc.

Link copied to clipboard
fun bottom(value: ScaledValueProperty)

This function is used to set the bottom padding or margin property according to the passed SpacesContext.bottomKey value like `padding-bottom`.

Link copied to clipboard
fun horizontal(value: ScaledValueProperty)

This function is used to set the horizontal padding or margin according to the passed SpacesContext.leftKey and SpacesContext.rightKey value like `padding-left` and ``padding-right`.

Link copied to clipboard
fun left(value: ScaledValueProperty)

This function is used to set the left padding or margin property according to the passed SpacesContext.leftKey value like `margin-left`.

Link copied to clipboard
fun right(value: ScaledValueProperty)

This function is used to set the right padding or margin property according to the passed SpacesContext.rightKey value like `padding-right`.

Link copied to clipboard
fun top(value: ScaledValueProperty)

This function is used to set the top padding or margin property according to the passed SpacesContext.topKey value like `margin-top`.

Link copied to clipboard
fun vertical(value: ScaledValueProperty)

This function is used to set the vertical padding or margin according to the passed SpacesContext.topKey and SpacesContext.bottomKey value like `margin-top` and ``margin-bottom`.

Properties

Link copied to clipboard
open override val lgProperties: StringBuilder

collects the properties for large screens

Link copied to clipboard
open override val mdProperties: StringBuilder

collects the properties for middle-sized screens

Link copied to clipboard
open override val smProperties: StringBuilder

collects the properties for small screens

Link copied to clipboard
val styleParams: StyleParams
Link copied to clipboard
open override val xlProperties: StringBuilder

collects the properties for extra-large screens