MediaQueryBuilder

Builds a list of MediaQuery conditions for a responsive breakpoint.

Each call appends one condition; build returns them in order. Conditions are combined implicitly (the breakpoint matches when all apply) unless nested under and/or/not.

Constructors

Link copied to clipboard
constructor()

Functions

Link copied to clipboard
fun and(block: MediaQueryBuilder.() -> Unit)

Adds a MediaQuery.Logical and group of the conditions declared in block.

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

Returns the accumulated conditions as an immutable list.

Link copied to clipboard
fun landscape()

Adds an orientation: landscape MediaQuery.OrientationFeature.

Link copied to clipboard
fun not(block: MediaQueryBuilder.() -> Unit)

Adds a negated MediaQuery.Not of the single condition declared in block.

Link copied to clipboard
fun or(block: MediaQueryBuilder.() -> Unit)

Adds a MediaQuery.Logical or group of the conditions declared in block.

Link copied to clipboard
fun portrait()

Adds an orientation: portrait MediaQuery.OrientationFeature.

Link copied to clipboard
fun print()

Adds a print media-type MediaQuery.TypeQuery.

Link copied to clipboard
operator fun <Error class: unknown class>.unaryPlus()

Appends a pre-built MediaQuery directly via the unary + operator.

Link copied to clipboard
fun width(min: <Error class: unknown class>? = null, max: <Error class: unknown class>? = null)

Adds a width MediaQuery.WidthFeature: pass min for min-width (>=) or max for max-width (<=). Exactly one must be given, and it must use Length.Unit.Px.

fun width(value: Number, operator: <Error class: unknown class>, unit: <Error class: unknown class> = MediaQuery.WidthFeature.Unit.Px)

Adds a width MediaQuery.WidthFeature with an explicit operator (e.g. >, <=).