Function: removeCssVariable()
ts
function removeCssVariable(key, ele?): void;Removes a CSS variable from the specified element or the root element.
Parameters
| Parameter | Type | Description |
|---|---|---|
key | string | The name of the CSS variable to remove. |
ele? | HTMLElement | The element from which to remove the CSS variable. If not specified, defaults to the root element. |
Returns
void
Example
ts
// Remove a CSS variable from the root element
removeCssVariable('--main-bg-color');
// Remove a CSS variable from a specific element
const element = document.querySelector('.my-element');
removeCssVariable('--main-bg-color', element)Since
1.0.0