Skip to main content

Class: DOMUtils

A utility class for doing DOM manipulation.

Methods​

applyStyles​

▸ applyStyles(ele, style): HTMLElement | HTMLElement[]

Apply styles directly onto DOM element(s).

Parameters​

NameTypeDescription
eleHTMLElement | HTMLElement[]The element(s) to add styles to.
stylePartial<CSSStyleDeclaration>The style(s) to add.

Returns​

HTMLElement | HTMLElement[]

The element(s) with the added styles.


mapKeyToCode​

▸ mapKeyToCode(key): string

Parameters​

NameType
keystring

Returns​

string


rgba​

▸ rgba(r, g, b, a): string

Create a CSS color string from numbers.

Parameters​

NameTypeDescription
rnumberRed channel
gnumberGreen channel
bnumberBlue channel
anumberAlpha channel

Returns​

string

A CSS color string