Border Context
This context class enables the definition of the common border styling properties like width, style and color.
This context is passed as receiver either by Border.border functions for setting the properties for all sides at once or by BordersContext functions for defining each side independently. Called by the latter this context acts as a nested context.
The definable properties for the direct usage by Border.border correspond to the border-width, border-style and border-color CSS properties.
This usage enables border styling like this:
border { /* it == BorderContext.() -> Unit */
width { thin }
style { dashed }
color { dark }
}
Used within the nested context those three properties correspond to the `border-{side}-{type}`
properties, where `type`
is one of `width`
, `style`
or `color`
and `side`
is one of `top`
, `right`
, `bottom`
or `left`
.
This usage enables border styling for each side like this:
borders { it == /* BordersContext.() -> Unit - with plural "s"! */
top { it == /* BorderContext.() -> Unit */
width { thin }
style { dashed }
color { dark }
},
bottom {
// some properties
},
// ... define the rest with ``right`` and ``left``
}
Parameters
the CSS-property for the color
the CSS-property for the style
basic context scope interface
the defined output StringBuilder to write the generated CSS into
the CSS-property for the width
Constructors
Functions
`border-{side}-color`
.`border-{side}-style`
.`border-{side}-width`
.