CssValue

class CssValue(text: String = "", val valid: Boolean = true)

Accumulator for CSS content attached to a com.kslides.KSlides or com.kslides.Presentation. Supports both raw-string and Kotlin CSS-DSL input via +=, and enforces that CSS is only declared at scopes that actually render a <style> tag.

Constructors

Link copied to clipboard
constructor(text: String = "", valid: Boolean = true)
constructor(other: CssValue)

Copy constructor — produces a new, writable CssValue seeded with other's text.

constructor(vararg elems: CssValue)

Combine multiple CssValue instances (each trimmed) into one.

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard

when false, any += or css{} call throws. Used by com.kslides.slide.Slide and com.kslides.VerticalSlidesContext to expose a CSS receiver that deliberately fails, catching the common mistake of trying to scope CSS per slide.

Functions

Link copied to clipboard
fun clear()

Remove all accumulated CSS.

Link copied to clipboard

true if any CSS has been accumulated.

Link copied to clipboard
operator fun plusAssign(block: CssBuilder.() -> Unit)

Append CSS built via the Kotlin CSS DSL.

operator fun plusAssign(other: String)

Append a raw CSS string. Leading indentation is trimmed so multi-line string literals do not produce unwanted whitespace.

Link copied to clipboard
fun prependIndent(indentToken: String): String

Return the accumulated CSS with indentToken prefixed to every line. Used for pretty output.

Link copied to clipboard
open override fun toString(): String

The raw accumulated CSS text.