StyleSheet

open class StyleSheet(name: String? = null, val isStatic: Boolean = true, imports: List<Import> = emptyList())(source)

Represents a reusable piece of CSS code

name is the stylesheet identifier. CSS class names are generated using a combination of name and property name. If not specified, object name obtained via reflection is used instead.

If isStatic property is set to true, a static, human-readable class selector will be created for every property, making referencing from other stylesheets possible. Generated class names will be used otherwise.

imports are the URLs (relative or absolute) of CSS files that will be added to the DOM with the first use of StyleSheet.

Constructors

Link copied to clipboard
constructor(name: String, parent: StyleSheet, isStatic: Boolean = true)
constructor(name: String? = null, isStatic: Boolean = true, imports: List<Import> = emptyList())

Properties

Link copied to clipboard
val isStatic: Boolean = true
Link copied to clipboard

Functions

Link copied to clipboard
fun css(vararg parents: RuleSet, builder: RuleSet): CssHolder
Link copied to clipboard

Use this function to assign a CSS class without any properties to an element

Link copied to clipboard
fun <T : Any> dynamicCss(builder: CssBuilder.(T) -> Unit): DynamicCssDelegate<T>

Declares properties with dynamic styles according to provided arguments.

Link copied to clipboard
fun inject()
Link copied to clipboard
Link copied to clipboard
fun scheduleToInject(className: String)