CssBuilder

A builder of CSS declarations (property-value pairs), with null-safe insertion.

Supports two output formats:

  • build produces a single-line inline style (e.g. for the style HTML attribute).

  • buildBlock produces an indented, multi-line block (e.g. for a stylesheet rule body).

Constructors

Link copied to clipboard
constructor()

Functions

Link copied to clipboard
fun build(): String
Link copied to clipboard
fun buildBlock(indent: String = " "): String
Link copied to clipboard

Like value, but appends !important to the declaration.

Link copied to clipboard
infix fun String.value(value: String?): CssBuilder

Shorthand syntactic sugar for entry.