Package dev.fritz2.styling.params

Types

Link copied to clipboard
typealias AlignContentProperty = Property

Alias for specific content alignment properties.

Link copied to clipboard
object AlignContentValues : PropertyValues

Predefined values for alignment of content Central Alignment Contexts inspired by https://drafts.csswg.org/css-align-3/

Link copied to clipboard
typealias AlignItemsProperty = Property

Alias for specific item alignment properties.

Link copied to clipboard
object AlignItemsValues : PropertyValues

Predefined values for alignment of items Central Alignment Contexts inspired by https://drafts.csswg.org/css-align-3/

Link copied to clipboard
interface Alignment : StyleParams

This context interface offers functions to align or justify elements.

Link copied to clipboard
typealias AreaName = String

Alias for the named areas of a grid layout.

Link copied to clipboard
typealias AutoFlowProperty = Property

Alias for the specific AutoFlowValues properties

Link copied to clipboard
object AutoFlowValues : PropertyValues

Predefined values for the grid-auto-flow property. Should be used as expression result for the GridLayout.autoFlow functions.

Link copied to clipboard
interface Background : StyleParams

This context interface offers functions to style the background related CSS properties of a component.

Link copied to clipboard
typealias BackgroundAttachmentProperty = Property
Link copied to clipboard
object BackgroundAttachments

Predefined values for the background-attachment property. Should be used as expression result in BackgroundContext.attachment.

Link copied to clipboard
typealias BackgroundBlendModeProperty = Property

Alias for the specific BackgroundBlendModes properties

Link copied to clipboard
object BackgroundBlendModes

Predefined values for the background-blend-mode property. Should be used as expression result in BackgroundContext.blendMode.

Link copied to clipboard
typealias BackgroundBoxProperty = Property
Link copied to clipboard
object BackgroundBoxValues

Predefined values for the background-origin and background-clip properties. Should be used as expression result in BackgroundContext.origin or BackgroundContext.clip.

Link copied to clipboard
class BackgroundContext(styleParams: StyleParams, target: StringBuilder) : StyleParams

This context class enables the definition of background related styling facilities.

Link copied to clipboard
class BackgroundPositionContext(values: MutableList<Property>)

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

Link copied to clipboard
typealias BackgroundPositionProperty = Property

Alias for the specific BackgroundPositions properties

Link copied to clipboard
object BackgroundPositions

Predefined values for the background-position property. Should be used as expression result in BackgroundContext.position, BackgroundPositionContext.horizontal or BackgroundPositionContext.vertical.

Link copied to clipboard
typealias BackgroundRepeatProperty = Property

Alias for the specific BackgroundRepeats properties

Link copied to clipboard
object BackgroundRepeats

Predefined values for the background-repeat property. Should be used as expression result in BackgroundContext.repeat.

Link copied to clipboard
class BackgroundSizeContext(values: MutableList<Property>)

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

Link copied to clipboard
typealias BackgroundSizeProperty = Property

Alias for the specific BackgroundSizes properties

Link copied to clipboard
object BackgroundSizes

Predefined values for the background-size property. Should be used as expression result in BackgroundContext.size, BackgroundSizeContext.horizontal or BackgroundSizeContext.vertical.

Link copied to clipboard
typealias BasicComponent<E> = (String?, String?, E.() -> Unit) -> E

Typealias for the common function signature of [RenderContext. methods. It is used for defining a generic extension method for styling basic HTML elements.

Link copied to clipboard
@ExperimentalCoroutinesApi
interface BasicParams : Space, Color, Border, Typo, Background, Position, Shadow, Layout, PseudoClasses, PseudoElements

interface combining all the basic style-parameters

Link copied to clipboard
@ExperimentalCoroutinesApi
interface Border : StyleParams

This context interface offers functions to style the border related CSS properties of a component.

Link copied to clipboard
@ExperimentalCoroutinesApi
class BorderContext(    widthKey: String,     styleKey: String,     colorKey: String,     val styleParams: StyleParams,     target: StringBuilder) : StyleParams

This context class enables the definition of the common border styling properties like width, style and color.

Link copied to clipboard
@ExperimentalCoroutinesApi
class BordersContext(val styleParams: StyleParams, target: StringBuilder) : StyleParams

This context class acts as an intermediate context to style the four sides of a border independently.

Link copied to clipboard
typealias BorderStyleProperty = Property

Alias for specific BorderStyleValues properties.

Link copied to clipboard
object BorderStyleValues : PropertyValues

Predefined values for the border-style property. Should be used as expression result in BorderContext.style.

Link copied to clipboard
@ExperimentalCoroutinesApi
interface BoxParams : FlexParams, GridParams

interface combining flex-style-parameters with grid and basic style-parameters

Link copied to clipboard
@ExperimentalCoroutinesApi
interface Color : StyleParams

This context interface offers functions to style the color related CSS properties of a component.

Link copied to clipboard
typealias ColorProperty = Property

alias for colors

Link copied to clipboard
typealias DirectionProperty = Property

Alias for the specific DirectionValues properties.

Link copied to clipboard
object DirectionValues : PropertyValues

Predefined values for the flex-direction property. Should be used as expression result in Flexbox.direction functions.

Link copied to clipboard
typealias DisplayProperty = Property

Alias for specific DisplayValues properties.

Link copied to clipboard
object DisplayValues : PropertyValues

Predefined values for the display property. Should be used as expression result in Layout.display.

Link copied to clipboard
typealias FlexBasisProperty = Property

Alias for specific FlexBasisValues properties.

Link copied to clipboard
object FlexBasisValues : PropertyValues

Predefined values for the flex-basis property. Should be used as expression result in FlexItemContext.basis.

Link copied to clipboard
@ExperimentalCoroutinesApi
interface Flexbox : StyleParams, Alignment

This context interface offers functions to styleflexbox-layouts.

Link copied to clipboard
@ExperimentalCoroutinesApi
class FlexItemContext(    styleParams: StyleParams,     selfAlignment: SelfAlignment,     target: StringBuilder) : StyleParams, SelfAlignment

This context interface offers functions to style elements of a flex layout.

Link copied to clipboard
@ExperimentalCoroutinesApi
interface FlexParams : BasicParams, Flexbox

interface combining flex-style-parameters with the basic style-parameters

Link copied to clipboard
typealias FontStyleProperty = Property

Alias for specific FontStyleProperty properties.

Link copied to clipboard
object FontStyles : PropertyValues

Predefined values for the font-style property. Should be used as expression result in Typo.fontStyle.

Link copied to clipboard
typealias FontWeightProperty = Property

Alias for specific FontWeightProperty properties.

Link copied to clipboard
object FontWeights : PropertyValues

Predefined values for the font-weight property. Should be used as expression result in Typo.fontWeight.

Link copied to clipboard
@ExperimentalCoroutinesApi
class GridAreaContext(styleParams: StyleParams, val target: StringBuilder) : StyleParams

This context class is responsible for defining the grid area layout as comfortable and safe as possible.

Link copied to clipboard
@ExperimentalCoroutinesApi
class GridContext(    styleParams: StyleParams,     selfAlignment: SelfAlignment,     target: StringBuilder) : StyleParams, SelfAlignment

This context interface offers functions to stylegrid layout-cells / child elements.

Link copied to clipboard
@ExperimentalCoroutinesApi
interface GridLayout : StyleParams, Alignment

This context interface offers functions to style the container component for grid-layouts.

Link copied to clipboard
@ExperimentalCoroutinesApi
interface GridParams : BasicParams, GridLayout

interface combining grid-style-parameters with the basic style-parameters

Link copied to clipboard
@ExperimentalCoroutinesApi
class GridRowColumnContext(    keyFragment: String,     styleParams: StyleParams,     target: StringBuilder) : StyleParams
Link copied to clipboard
@ExperimentalCoroutinesApi
class GridTemplateContext(styleParams: StyleParams, target: StringBuilder) : StyleParams

This context class enables to set the template properties for rows, columns and their corresponding automatic variants for dynamically added rows or columns (have a look at Auto placement documentation) in a flexible yet comfortable way.

Link copied to clipboard
typealias JustifyContentProperty = Property

Alias for specific justification properties.

Link copied to clipboard
object JustifyContentValues : PropertyValues

Predefined values for justification Central Alignment Contexts inspired by https://drafts.csswg.org/css-align-3/

Link copied to clipboard
@ExperimentalCoroutinesApi
interface Layout : StyleParams

This context interface offers different functions to define or affect the fundamental layout of the whole page, a container within the page or an element itself.

Link copied to clipboard
open class OverflowBaseValues(val key: String) : PropertyValues

Predefined common values for the overflow related properties.

Link copied to clipboard
typealias OverflowProperty = Property

Alias for specific OverflowBaseValues properties.

Link copied to clipboard
object OverflowValues : OverflowBaseValues

Predefined values for the overflow property. Should be used as expression result in Layout.overflow.

Link copied to clipboard
object OverflowXValues : OverflowBaseValues

Predefined values for the overflow-x property. Should be used as expression result in Layout.overflowX.

Link copied to clipboard
object OverflowYValues : OverflowBaseValues

Predefined values for the overflow-y property. Should be used as expression result in Layout.overflowY.

Link copied to clipboard
@ExperimentalCoroutinesApi
interface Position : StyleParams

This context interface offers two functions to specify the positional appearance of an element.

Link copied to clipboard
@ExperimentalCoroutinesApi
class PositionContext(val styleParams: StyleParams, target: StringBuilder) : StyleParams

This context class acts as an intermediate context to set the position of an element and to specify the actual positioning concerning the sides distances too.

Link copied to clipboard
@ExperimentalCoroutinesApi
class PositioningContext(val styleParams: StyleParams, target: StringBuilder) : StyleParams

This context class enables the definition of positioning properties for the four directions of top, right, bottom and left and convenience functions for defining the horizontal or vertical aspects at once.

Link copied to clipboard
interface PropertyValues

base-interface for all enum base properties

Link copied to clipboard
@ExperimentalCoroutinesApi
interface PseudoClasses : StyleParams
Link copied to clipboard
@ExperimentalCoroutinesApi
interface PseudoElements : StyleParams
Link copied to clipboard
@ExperimentalCoroutinesApi
class RadiiContext(val styleParams: StyleParams, target: StringBuilder) : StyleParams

This context class is used to provide a scope for styling the four radii of a border independently.

Link copied to clipboard
typealias ScaledValueProperty = ScaledValue.() -> Property

shortcut for functions that derive a value from ScaledValue defined at the Theme

Link copied to clipboard
typealias SelfAlignItemProperty = Property

Alias for specific self alignment properties.

Link copied to clipboard
object SelfAlignItemsValues : PropertyValues

Predefined values for self alignment Central Alignment Contexts inspired by https://drafts.csswg.org/css-align-3/

Link copied to clipboard
interface SelfAlignment

This context interface offers functions for self-alignment.

Link copied to clipboard
interface Shadow : StyleParams

This context interface offers functions to style the shadow related CSS properties of a component.

Link copied to clipboard
typealias ShadowProperty = Property

Alias for specific Shadow properties.

Link copied to clipboard
typealias SizesProperty = Sizes.() -> Property

shortcut for functions that derive a value from SizesProperty defined at the Theme

Link copied to clipboard
@ExperimentalCoroutinesApi
interface Space : StyleParams

This context interface offers functions to style the space related CSS properties of a component.

Link copied to clipboard
@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.

Link copied to clipboard
typealias Style<T> = T.() -> Unit

shortcut for a function defining style-parameters

Link copied to clipboard
interface StyleParams

Basic interface for all StyleParams-classes

Link copied to clipboard
@ExperimentalCoroutinesApi
open class StyleParamsImpl : BoxParams

Implemantation of all StyleParams-interface providing the needed StringBuilders

Link copied to clipboard
annotation class StyleParamsMarker

DSLMarker-annotation for style-parameter-DSL

Link copied to clipboard
typealias TextAlignProperty = Property

Alias for specific TextAlignProperty properties.

Link copied to clipboard
object TextAligns : PropertyValues

Predefined values for the text-align property. Should be used as expression result in Typo.textAlign.

Link copied to clipboard
typealias TextDecorationProperty = Property

Alias for specific TextDecorations properties.

Link copied to clipboard
object TextDecorations : PropertyValues

Predefined values for the font-weight property. Should be used as expression result in Typo.textDecoration.

Link copied to clipboard
typealias TextTransformProperty = Property

Alias for specific TextTransformProperty properties.

Link copied to clipboard
object TextTransforms : PropertyValues

Predefined values for the text-transform property. Should be used as expression result in Typo.textTransform.

Link copied to clipboard
@ExperimentalCoroutinesApi
interface Typo : StyleParams

This context interface offers functions to style the typography related CSS properties of a component.

Link copied to clipboard
typealias VerticalAlignProperty = Property

Alias for specific VerticalAlignValues properties.

Link copied to clipboard
object VerticalAlignValues : PropertyValues

Predefined values for the vertical-align property. Should be used as expression result in Layout.verticalAlign.

Link copied to clipboard
typealias WeightedValueProperty = WeightedValue.() -> Property

shortcut for functions that derive a value from WeightedValue defined at the Theme

Link copied to clipboard
typealias WrapProperty = Property

Alias for the specific WrapValues properties.

Link copied to clipboard
object WrapValues : PropertyValues

Predefined values for the flex-wrap property. Should be used as expression result in Flexbox.wrap functions.

Link copied to clipboard
typealias ZIndicesProperty = ZIndices.() -> Property

shortcut for functions that derive a value from ZIndicesProperty defined at the Theme

Functions

Link copied to clipboard
fun alterHexColorBrightness(color: ColorProperty, brightness: Double): ColorProperty

alters the brightness of a given input color in the hex format. Enter a value between 1 and 2 to increase brightness, and a value between 0 and 1 to decrease brightness. Increasing the brightness of a color lets them appear rather faded than shining.

Link copied to clipboard
infix fun ShadowProperty.and(other: ShadowProperty): ShadowProperty

combines to shadow property values created by shadow

Link copied to clipboard
fun hsl(    h: Int,     s: Int,     l: Int): String

creates a ColorProperty from hsl-values

Link copied to clipboard
fun hsla(    h: Int,     s: Int,     l: Int,     a: Double): String

creates a ColorProperty from hsla-values

Link copied to clipboard
inline operator fun <T> Style<T>.plus(crossinline other: Style<T>): Style<T>

combines to Styles

Link copied to clipboard
inline fun <T : PropertyValues> StyleParams.property(base: T, value: T.() -> Property)

sets an enum-based property for small-screens (default)

fun StyleParams.property(    key: String,     value: Property,     target: StringBuilder)

sets a property for a given target screen size

inline fun <T> StyleParams.property(    key: String,     base: T,     value: T.() -> Property,     target: StringBuilder)

sets a property derived from the Theme

fun <T : PropertyValues> StyleParams.property(    base: T,     sm: T.() -> Property? = null,     md: T.() -> Property? = null,     lg: T.() -> Property? = null,     xl: T.() -> Property? = null)

sets a responsive enum-based property

fun StyleParams.property(    key: String,     sm: Property? = null,     md: Property? = null,     lg: Property? = null,     xl: Property? = null)

sets a responsive property for

fun <T> StyleParams.property(    key: String,     base: T,     sm: T.() -> Property? = null,     md: T.() -> Property? = null,     lg: T.() -> Property? = null,     xl: T.() -> Property? = null)

sets a responsive property derived from the Theme

Link copied to clipboard
fun rgb(    r: Int,     g: Int,     b: Int): String

creates a ColorProperty from rgb-values

Link copied to clipboard
fun rgba(    r: Int,     g: Int,     b: Int,     a: Double): String

creates a ColorProperty from rgba-values

Link copied to clipboard
fun shadow(    offsetHorizontal: String,     offsetVertical: String = offsetHorizontal,     blur: String? = null,     spread: String? = null,     color: String? = null,     inset: Boolean = false): ShadowProperty

creates a valid value for shadow-properties like box-shadow or text-shadow

Link copied to clipboard
fun <E> BasicComponent<E>.styled(    baseClass: StyleClass = StyleClass.None,     id: String? = null,     prefix: String = "css",     styling: BoxParams.() -> Unit): RenderContext.(E.() -> Unit) -> E

Extension method that enables the usage of fritz2's powerful styling DSL for basic HTML elements. This method is used for unstyled HTML elements.

fun <E> BasicComponent<E>.styled(    parentStyling: BoxParams.() -> Unit = {},     baseClass: StyleClass = StyleClass.None,     id: String? = null,     prefix: String = "css",     styling: BoxParams.() -> Unit): RenderContext.(E.() -> Unit) -> E

Extension method that enables the usage of fritz2's powerful styling DSL for basic HTML elements. This method is used for HTML elements that should apply an additional dynamic styling provided as external parameter. This is needed and extremely useful for implementing components!

Properties

Link copied to clipboard
const val boxShadowKey: String
Link copied to clipboard
const val cssDelimiter: String
Link copied to clipboard
val AreaName.end: String

Extension property that generates the value for the end grid line of an area

Link copied to clipboard
val AreaName.middle: String

Extension property that generates the value for the middle between the start and end grid lines of an area

Link copied to clipboard
val AreaName.start: String

Extension property that generates the value for the start grid line of an area

Link copied to clipboard
const val textShadowKey: String