A React Hook that allows you to use CSS variables in your components.
Try to toggle dark mode or click button below to see the effect.
See API for more details.
Click links below to view source on GitHub.
string
, The name of the CSS variable you want to use.
ElementTarget
is a union type that represents various kinds of elements that can be targeted.
See ElementTarget or ElementTarget Types for more details.
() => document.documentElement
by defaults.
Same as React.useState, a tuple with the current value of the CSS variable and a function to update it.