SilkStylesheet

Access to useful methods that can append CSS styles and keyframes to the global stylesheet provided by Silk.

You can use this as a replacement for defining your own stylesheet using Compose HTML. In addition to being fewer lines of code, this provides an API that lets you work with Modifiers for providing styles.

Properties

Link copied to clipboard

Users can specify custom CSS layers here, to extend the initial set provided by Silk.

Functions

Link copied to clipboard
abstract fun layer(name: String, block: CssStyleRegistrar.() -> Unit)

Create a layer which then wraps a collection of CSS styles.

Link copied to clipboard
Link copied to clipboard
abstract fun registerKeyframes(name: String, build: KeyframesBuilder.() -> Unit)
Link copied to clipboard
abstract fun registerStyle(cssSelector: String, init: StyleScope.() -> Unit)

An alternate way to register global styles with Silk instead of using a Compose HTML StyleSheet directly.

Link copied to clipboard
fun CssStyleRegistrar.registerStyleBase(cssSelector: String, init: () -> Modifier)

Convenience method when you only care about registering the base method, which can help avoid a few extra lines.