Tag name of the Element representation of target
.
Element representation of the specified target
.
InvalidCssVarError
if a CSS variable could not be removed from target
.
elements!InvalidElementError
if the specified target
wasn't found.
HTML (Before)
<style>
:root {
--color-fg: green;
--padding-small: "24px";
--is-small: true;
}
</style>
<button id="example" style="--color-bg: blue; --is-big: true; font-size: 18px;">
Example
</button>
Remove from Element
const element = findElement("#example")!;
removeCssVars(["--color-bg", "--is-big"] , element);
Remove from :root
removeCssVars(["--color-fg", "--padding-small"]);
HTML (After)
<style>
:root {
--is-small: true;
}
</style>
<button id="example" style="font-size: 18px;">
Example
</button>
Removes the CSS variables with
names
from the optionally specifiedtarget
.If no
target
is specified, usesdocumentElement
(i.e.:root
).