StylesheetBuilder

Constructors

Link copied to clipboard
constructor()

Functions

Link copied to clipboard
fun blockquote(block: RuleBuilder.() -> Unit)
Link copied to clipboard
fun body(block: RuleBuilder.() -> Unit)
Link copied to clipboard
fun firstParagraph(block: RuleBuilder.() -> Unit)

Targets the first paragraph in its container (p:first-of-type).

Link copied to clipboard
fun heading(level: Int, block: RuleBuilder.() -> Unit)
Link copied to clipboard
fun image(block: RuleBuilder.() -> Unit)
Link copied to clipboard
fun link(block: RuleBuilder.() -> Unit)
Link copied to clipboard
fun paragraph(block: RuleBuilder.() -> Unit)
Link copied to clipboard

Targets any paragraph that immediately follows another paragraph (p + p). Use this for the alternative convention where the indent is added by the following paragraph rather than removed from the first — handy if your XHTML mixes paragraphs and figures and you only want to indent run-on prose.

Link copied to clipboard

Targets the first letter of paragraphs (p::first-letter). Use for drop caps. Pair with firstParagraph (and combine via selector with p:first-of-type::first-letter) for chapter-opener drop caps.

Link copied to clipboard

Targets the first formatted line of paragraphs (p::first-line). Use for small caps on the opening line of each paragraph.

Link copied to clipboard
fun raw(css: String)

Escape hatch for arbitrary CSS — @font-face, media queries, anything.

Link copied to clipboard
fun render(): String
Link copied to clipboard
fun selector(selector: String, block: RuleBuilder.() -> Unit)

Escape hatch for arbitrary selectors.