MediaList

The MediaList interface represents the media queries of a stylesheet, e.g., those set using a link element's media attribute.

MDN Reference

Properties

Link copied to clipboard
open override val length: Int

The read-only length property of the MediaList interface returns the number of media queries in the list.

Link copied to clipboard

The mediaText property of the MediaList interface is a stringifier that returns a string representing the MediaList as text, and also allows you to set a new MediaList.

Functions

Link copied to clipboard

The appendMedium() method of the MediaList interface adds a media query to the list.

Link copied to clipboard

The deleteMedium() method of the MediaList interface removes from this MediaList the given media query.

Link copied to clipboard
open operator fun get(index: Int): MediaQuery
open operator fun get(key: Symbol.iterator): () -> JsIterator<MediaQuery>
Link copied to clipboard
fun item(index: Int): MediaQuery?

The item() method of the MediaList interface returns the media query at the specified index, or null if the specified index doesn't exist.

Link copied to clipboard
open inline operator fun iterator(): Iterator<MediaQuery>