Package dev.fritz2.styling

Types

StyleClass
Link copied to clipboard
js
inline class StyleClass(name: String)
alias for CSS class names

Functions

classList
Link copied to clipboard
js
fun <E : Element> Tag<E>.classList(values: Flow<List<StyleClass>>)
classMap
Link copied to clipboard
js
fun <E : Element> Tag<E>.classMap(values: Flow<Map<StyleClass, Boolean>>)
className
Link copied to clipboard
js
fun <E : Element> Tag<E>.className(values: Flow<StyleClass>)
resetCss
Link copied to clipboard
js
fun resetCss(css: String)
staticStyle
Link copied to clipboard
js
fun staticStyle(css: String)
adds some static css to your app's dynamic style sheet.
fun staticStyle(name: String, styling: BoxParams.() -> Unit): StyleClass
adds a static css-class to your app's dynamic style sheet.
fun staticStyle(name: String, css: String): StyleClass
adds a static css-class to your app's dynamic style sheet.
style
Link copied to clipboard
js
fun style(prefix: String = "s", styling: BoxParams.() -> Unit): StyleClass
creates a dynamic css-class and add it to your app's dynamic style sheet.
fun style(css: String, prefix: String = "s"): StyleClass
creates a dynamic css-class and add it to your app's dynamic style sheet.
whenever
Link copied to clipboard
js
fun StyleClass.whenever(upstream: Flow<Boolean>): Flow<StyleClass>
function to apply a given class only when a condition is fullfiled.
inline fun <T> StyleClass.whenever(upstream: Flow<T>, crossinline mapper: suspend (T) -> Boolean): Flow<StyleClass>
function to apply a given class only when a condition is fullfiled.

Properties

name
Link copied to clipboard
js
val Flow<StyleClass>.name: Flow<String>
use name on a Flow<StyleClass> just as you do on StyleClass to apply it whereever class-names are required as Strings