Hype Style Caster (main) doxdox documentation

Create and override inline styles or cast value changes to custom properties (CSS Vars)

# _local.updateTree(mutations)

Parameters

Name Types Description
mutations MutationRecord[] - The mutations to be observed

# createStyleSheet(id)

Creates a style sheet with the given id and returns it.

Parameters

Name Types Description
id string - the id of the style sheet

# getDefault(key)

This function returns the value of a default by key or all default if no key is given

Parameters

Name Types Description
key String This the key of the default.

Returns

Returns the current value for a default with a certain key.

# hypeDocument.setElementStyle(element, style)

Parameters

Name Types Description
element HTMLElement - The element to be styled
style string - The style to be applied to the element

# insertStyle(id, style)

Parameters

Name Types Description
id string - The id of the element
style string - The style to be inserted

# isValidCSS(str)

Parameters

Name Types Description
str string - The string to be checked

# parseTransform(prop, string)

Parameters

Name Types Description
prop string - The property to be parsed
string string - The string to be parsed

# registerCastingFunction(name, func)

Parameters

Name Types Description
name string - The name of the casting function
func function - The function to be registered

# removeStyle(id)

Parameters

Name Types Description
id string - The id of the element

# removeStyleVariable(str, baseElm)

Remove a style variable from all elements in the base element

Parameters

Name Types Description
str string - the style variable to remove
baseElm HTMLElement - the base element to search in

# resolveCastingFunction(cmd, value)

Parameters

Name Types Description
cmd string - The casting command
value string - The value to be casted

# resolveProp(prop)

Parameters

Name Types Description
prop string - The CSS property to be resolved

# setDefault(key, value)

This function allows to override a global default by key or if a object is given as key to override all default at once

Parameters

Name Types Description
key String This is the key to override
value String Function

# setStyle(id, style)

Parameters

Name Types Description
id string - The id of the element
style object - The style object to be set

# styleToString(style)

Parameters

Name Types Description
style object - The style object to be converted

# updateStyle(id, style)

Parameters

Name Types Description
id string - The id of the element
style string - The style to be inserted

# updateVars(mutations)

Parameters

Name Types Description
mutations MutationRecord[] - The mutations to be observed

# updateVarsForElementOnBase(styleVariableName, elm)

Parameters

Name Types Description
styleVariableName string - The name of the CSS variable
elm HTMLElement - The element to be updated