SpacesContext

@ExperimentalCoroutinesApi()
class SpacesContext(topKey: String, leftKey: String, bottomKey: String, rightKey: String, 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

bottomKey

the CSS-property for the bottom

leftKey

the CSS-property for the left

rightKey

the CSS-property for the right

styleParams

basic context scope interface

target

the defined output StringBuilder to write the generated CSS into

topKey

the CSS-property for the top

Constructors

SpacesContext
Link copied to clipboard
js
fun SpacesContext(topKey: String, leftKey: String, bottomKey: String, rightKey: String, styleParams: StyleParams, target: StringBuilder)
the CSS-property for the top

Functions

all
Link copied to clipboard
js
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.
bottom
Link copied to clipboard
js
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`.
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: 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`.
left
Link copied to clipboard
js
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`.
right
Link copied to clipboard
js
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`.
top
Link copied to clipboard
js
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`.
toString
Link copied to clipboard
js
open fun toString(): String
vertical
Link copied to clipboard
js
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

lgProperties
Link copied to clipboard
js
open override val lgProperties: StringBuilder
collects the properties for large screens
mdProperties
Link copied to clipboard
js
open override val mdProperties: StringBuilder
collects the properties for middle-sized screens
smProperties
Link copied to clipboard
js
open override val smProperties: StringBuilder
collects the properties for small screens
styleParams
Link copied to clipboard
js
val styleParams: StyleParams
basic context scope interface
xlProperties
Link copied to clipboard
js
open override val xlProperties: StringBuilder
collects the properties for extra-large screens