Class

CustomProperty

CustomProperty(name, value, contextopt)

Class represents a custom CSS property
Constructor

# new CustomProperty(name, value, contextopt)

Parameters:
Name Type Attributes Default Description
name string The CSS property name
value string | number The CSS property value
context HTMLElement <optional>
document.documentElement The DOM Element style with apply to

View Source src/CustomProperty.js, line 7

Example
const property = new CustomProperty('name', 10);

Members

any

# static value

The property value

View Source src/CustomProperty.js, line 31

Example
const property = new CustomProperty('name', 10);
// Also updates the DOM style
property.value = 100;

Methods

# destroy()

Sets value to null and clears DOM style

View Source src/CustomProperty.js, line 55

# toString() → {string}

Transforms this to string

View Source src/CustomProperty.js, line 49

The string representation of this.
string
Example
const property = new CustomProperty('name', 10);
console.log(`${property}`);