MediaList

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

MDN Reference

Properties

Link copied to clipboard
open external 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
external var mediaText: String

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
external fun appendMedium(medium: MediaQuery)

The appendMedium() method of the MediaList interface adds a media query to the list. If the media query is already in the collection, this method does nothing.

Link copied to clipboard
external fun deleteMedium(medium: MediaQuery)

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

Link copied to clipboard
open operator external fun get(index: Int): MediaQuery
Link copied to clipboard
external 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.