SpecBuilder

Builder for a top-level Spec: its style record, breakpoints, and root layout node.

Constructors

Link copied to clipboard
constructor()

Properties

Link copied to clipboard

Document schema version, written to Spec.version; must be 1. Defaults to 1.

Functions

Link copied to clipboard

Appends a responsive Breakpoint, built via BreakpointBuilder.

Link copied to clipboard
fun build(): <Error class: unknown class>

Builds the Spec.

Link copied to clipboard
fun layout(node: <Error class: unknown class>)

Sets the root layout from a prebuilt Node.

fun layout(block: LayoutScope.() -> Unit)

Sets the root layout from a LayoutScope body. The body must contribute exactly one top-level node (e.g. a single div { ... }).

fun layout(type: String, block: NodeBuilder.() -> Unit = {})

Sets the root layout to a node of the given type, built via NodeBuilder.

Link copied to clipboard
fun style(selector: String, value: <Error class: unknown class>)

Adds a style entry mapping a CSS selector to a prebuilt Style.

fun style(selector: String, block: StyleBuilder.() -> Unit)

Adds a style entry mapping a CSS selector (div, .class, #id) to a Style built via StyleBuilder.